diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4208b5c..ac03171 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.6.0" + ".": "0.6.1" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index ba1c7c9..4a84456 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 15 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-5d4e11bc46eeecee7363d56a9dfe946acee997d5b352c2b0a50c20e742c54d2d.yml -openapi_spec_hash: 333e53ad9c706296b9afdb8ff73bec8f -config_hash: 0fdf285ddd8dee229fd84ea57df9080f +configured_endpoints: 16 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-b019e469425a59061f37c5fdc7a131a5291c66134ef0627db4f06bb1f4af0b15.yml +openapi_spec_hash: f66a3c2efddb168db9539ba2507b10b8 +config_hash: aae6721b2be9ec8565dfc8f7eadfe105 diff --git a/CHANGELOG.md b/CHANGELOG.md index 25d053c..0ad0718 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.6.1 (2025-06-18) + +Full Changelog: [v0.6.0...v0.6.1](https://github.com/onkernel/kernel-python-sdk/compare/v0.6.0...v0.6.1) + +### Features + +* **api:** add delete_browsers endpoint ([1d378d3](https://github.com/onkernel/kernel-python-sdk/commit/1d378d3a505c2bce7453a7da3fc70ce78f8349cf)) + ## 0.6.0 (2025-06-18) Full Changelog: [v0.5.0...v0.6.0](https://github.com/onkernel/kernel-python-sdk/compare/v0.5.0...v0.6.0) diff --git a/api.md b/api.md index cb25dcb..0127e61 100644 --- a/api.md +++ b/api.md @@ -67,6 +67,7 @@ Methods: - client.invocations.create(\*\*params) -> InvocationCreateResponse - client.invocations.retrieve(id) -> InvocationRetrieveResponse - client.invocations.update(id, \*\*params) -> InvocationUpdateResponse +- client.invocations.delete_browsers(id) -> None - client.invocations.follow(id) -> InvocationFollowResponse # Browsers diff --git a/pyproject.toml b/pyproject.toml index 3bfd297..e783ee3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "kernel" -version = "0.6.0" +version = "0.6.1" description = "The official Python library for the kernel API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/kernel/_version.py b/src/kernel/_version.py index c6e626d..23bc576 100644 --- a/src/kernel/_version.py +++ b/src/kernel/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "kernel" -__version__ = "0.6.0" # x-release-please-version +__version__ = "0.6.1" # x-release-please-version diff --git a/src/kernel/resources/invocations.py b/src/kernel/resources/invocations.py index c87b8d7..3de46d0 100644 --- a/src/kernel/resources/invocations.py +++ b/src/kernel/resources/invocations.py @@ -8,7 +8,7 @@ import httpx from ..types import invocation_create_params, invocation_update_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +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 @@ -183,6 +183,40 @@ def update( cast_to=InvocationUpdateResponse, ) + def delete_browsers( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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: + """ + Delete all browser sessions created within the specified 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 id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return self._delete( + f"/invocations/{id}/browsers", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + def follow( self, id: str, @@ -379,6 +413,40 @@ async def update( cast_to=InvocationUpdateResponse, ) + async def delete_browsers( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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: + """ + Delete all browser sessions created within the specified 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 id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return await self._delete( + f"/invocations/{id}/browsers", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + async def follow( self, id: str, @@ -433,6 +501,9 @@ def __init__(self, invocations: InvocationsResource) -> None: self.update = to_raw_response_wrapper( invocations.update, ) + self.delete_browsers = to_raw_response_wrapper( + invocations.delete_browsers, + ) self.follow = to_raw_response_wrapper( invocations.follow, ) @@ -451,6 +522,9 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None: self.update = async_to_raw_response_wrapper( invocations.update, ) + self.delete_browsers = async_to_raw_response_wrapper( + invocations.delete_browsers, + ) self.follow = async_to_raw_response_wrapper( invocations.follow, ) @@ -469,6 +543,9 @@ def __init__(self, invocations: InvocationsResource) -> None: self.update = to_streamed_response_wrapper( invocations.update, ) + self.delete_browsers = to_streamed_response_wrapper( + invocations.delete_browsers, + ) self.follow = to_streamed_response_wrapper( invocations.follow, ) @@ -487,6 +564,9 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None: self.update = async_to_streamed_response_wrapper( invocations.update, ) + self.delete_browsers = async_to_streamed_response_wrapper( + invocations.delete_browsers, + ) self.follow = async_to_streamed_response_wrapper( invocations.follow, ) diff --git a/tests/api_resources/test_invocations.py b/tests/api_resources/test_invocations.py index c11ea7c..4fbd460 100644 --- a/tests/api_resources/test_invocations.py +++ b/tests/api_resources/test_invocations.py @@ -171,6 +171,48 @@ def test_path_params_update(self, client: Kernel) -> None: status="succeeded", ) + @pytest.mark.skip() + @parametrize + def test_method_delete_browsers(self, client: Kernel) -> None: + invocation = client.invocations.delete_browsers( + "id", + ) + assert invocation is None + + @pytest.mark.skip() + @parametrize + def test_raw_response_delete_browsers(self, client: Kernel) -> None: + response = client.invocations.with_raw_response.delete_browsers( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invocation = response.parse() + assert invocation is None + + @pytest.mark.skip() + @parametrize + def test_streaming_response_delete_browsers(self, client: Kernel) -> None: + with client.invocations.with_streaming_response.delete_browsers( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invocation = response.parse() + assert invocation is None + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_delete_browsers(self, client: Kernel) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.invocations.with_raw_response.delete_browsers( + "", + ) + @pytest.mark.skip( reason="currently no good way to test endpoints with content type text/event-stream, Prism mock server will fail" ) @@ -374,6 +416,48 @@ async def test_path_params_update(self, async_client: AsyncKernel) -> None: status="succeeded", ) + @pytest.mark.skip() + @parametrize + async def test_method_delete_browsers(self, async_client: AsyncKernel) -> None: + invocation = await async_client.invocations.delete_browsers( + "id", + ) + assert invocation is None + + @pytest.mark.skip() + @parametrize + async def test_raw_response_delete_browsers(self, async_client: AsyncKernel) -> None: + response = await async_client.invocations.with_raw_response.delete_browsers( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invocation = await response.parse() + assert invocation is None + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_delete_browsers(self, async_client: AsyncKernel) -> None: + async with async_client.invocations.with_streaming_response.delete_browsers( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invocation = await response.parse() + assert invocation is None + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_delete_browsers(self, async_client: AsyncKernel) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.invocations.with_raw_response.delete_browsers( + "", + ) + @pytest.mark.skip( reason="currently no good way to test endpoints with content type text/event-stream, Prism mock server will fail" )