From dc2b67b44f663bb6674d6bbd10f95e429253ee16 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:35 +0000
Subject: [PATCH] feat(api): api update
---
.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