From 420658a5b7fd92eb412cfa6d4b802ea16bdc1345 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 23:18:04 +0000 Subject: [PATCH 1/3] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8ed1b33..1bda9d3 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/kernel%2Fkernel-20310988401243aa5c4a2e2ac6cba5dd90873fb7b83497a2d50c691352c0dd7b.yml -openapi_spec_hash: e19e650b4b2c8c8fde1f739c4aab6b33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-403eadeddcd92ecf5c0ada739fb59d73d829a9b463788a81ac3ed97d0cd3a64b.yml +openapi_spec_hash: 8fdd3a5bd5e035f0adeb72329c215ad7 config_hash: 16e4457a0bb26e98a335a1c2a572290a From cdd4b026fc01b1118cbc35cbc61890d15af3e021 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 18:48:26 +0000 Subject: [PATCH 2/3] feat: Add optional url parameter to proxy check endpoint --- .stats.yml | 4 +-- api.md | 2 +- src/kernel/resources/proxies.py | 48 +++++++++++++++++++++++--- src/kernel/types/__init__.py | 1 + src/kernel/types/proxy_check_params.py | 23 ++++++++++++ tests/api_resources/test_proxies.py | 34 +++++++++++++----- 6 files changed, 96 insertions(+), 16 deletions(-) create mode 100644 src/kernel/types/proxy_check_params.py diff --git a/.stats.yml b/.stats.yml index 1bda9d3..4bc313e 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/kernel%2Fkernel-403eadeddcd92ecf5c0ada739fb59d73d829a9b463788a81ac3ed97d0cd3a64b.yml -openapi_spec_hash: 8fdd3a5bd5e035f0adeb72329c215ad7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-f7024f4171c7c4ec558de1c27f338b1089ffddd0d2dbfdb9bb9f9c2abe8f47bf.yml +openapi_spec_hash: ced43682b49e73a2862f99b49abb4fcd config_hash: 16e4457a0bb26e98a335a1c2a572290a diff --git a/api.md b/api.md index 696c481..5e43066 100644 --- a/api.md +++ b/api.md @@ -282,7 +282,7 @@ Methods: - client.proxies.retrieve(id) -> ProxyRetrieveResponse - client.proxies.list() -> ProxyListResponse - client.proxies.delete(id) -> None -- client.proxies.check(id) -> ProxyCheckResponse +- client.proxies.check(id, \*\*params) -> ProxyCheckResponse # Extensions diff --git a/src/kernel/resources/proxies.py b/src/kernel/resources/proxies.py index f259d6e..bacdd57 100644 --- a/src/kernel/resources/proxies.py +++ b/src/kernel/resources/proxies.py @@ -6,7 +6,7 @@ import httpx -from ..types import proxy_create_params +from ..types import proxy_check_params, proxy_create_params from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given from .._utils import path_template, maybe_transform, async_maybe_transform from .._compat import cached_property @@ -195,6 +195,7 @@ def check( self, id: str, *, + url: 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, @@ -202,10 +203,27 @@ def check( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProxyCheckResponse: - """ - Run a health check on the proxy to verify it's working. + """Run a health check on the proxy to verify it's working. + + Optionally specify a URL + to test reachability against a specific target. For ISP and datacenter proxies, + this reliably tests whether the target site is reachable from the proxy's stable + exit IP. For residential and mobile proxies, the exit node varies between + requests, so this validates proxy configuration and connectivity rather than + guaranteeing site-specific reachability. Args: + url: An optional URL to test reachability against. If provided, the proxy check will + test connectivity to this URL instead of the default test URLs. Only HTTP and + HTTPS schemes are allowed, and the URL must resolve to a public IP address. For + ISP and datacenter proxies, the exit IP is stable, so a successful check + reliably indicates that subsequent browser sessions will reach the target site + with the same IP. For residential and mobile proxies, the exit node changes + between requests, so a successful check validates proxy configuration but does + not guarantee that a subsequent browser session will use the same exit IP or + reach the same site — it is useful for verifying credentials and connectivity, + not for predicting site-specific behavior. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -218,6 +236,7 @@ def check( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( path_template("/proxies/{id}/check", id=id), + body=maybe_transform({"url": url}, proxy_check_params.ProxyCheckParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -394,6 +413,7 @@ async def check( self, id: str, *, + url: 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, @@ -401,10 +421,27 @@ async def check( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProxyCheckResponse: - """ - Run a health check on the proxy to verify it's working. + """Run a health check on the proxy to verify it's working. + + Optionally specify a URL + to test reachability against a specific target. For ISP and datacenter proxies, + this reliably tests whether the target site is reachable from the proxy's stable + exit IP. For residential and mobile proxies, the exit node varies between + requests, so this validates proxy configuration and connectivity rather than + guaranteeing site-specific reachability. Args: + url: An optional URL to test reachability against. If provided, the proxy check will + test connectivity to this URL instead of the default test URLs. Only HTTP and + HTTPS schemes are allowed, and the URL must resolve to a public IP address. For + ISP and datacenter proxies, the exit IP is stable, so a successful check + reliably indicates that subsequent browser sessions will reach the target site + with the same IP. For residential and mobile proxies, the exit node changes + between requests, so a successful check validates proxy configuration but does + not guarantee that a subsequent browser session will use the same exit IP or + reach the same site — it is useful for verifying credentials and connectivity, + not for predicting site-specific behavior. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -417,6 +454,7 @@ async def check( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( path_template("/proxies/{id}/check", id=id), + body=await async_maybe_transform({"url": url}, proxy_check_params.ProxyCheckParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/kernel/types/__init__.py b/src/kernel/types/__init__.py index 894342a..0e740fb 100644 --- a/src/kernel/types/__init__.py +++ b/src/kernel/types/__init__.py @@ -20,6 +20,7 @@ from .app_list_params import AppListParams as AppListParams from .browser_pool_ref import BrowserPoolRef as BrowserPoolRef from .app_list_response import AppListResponse as AppListResponse +from .proxy_check_params import ProxyCheckParams as ProxyCheckParams from .browser_list_params import BrowserListParams as BrowserListParams from .browser_persistence import BrowserPersistence as BrowserPersistence from .credential_provider import CredentialProvider as CredentialProvider diff --git a/src/kernel/types/proxy_check_params.py b/src/kernel/types/proxy_check_params.py new file mode 100644 index 0000000..de3a8c3 --- /dev/null +++ b/src/kernel/types/proxy_check_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 TypedDict + +__all__ = ["ProxyCheckParams"] + + +class ProxyCheckParams(TypedDict, total=False): + url: str + """An optional URL to test reachability against. + + If provided, the proxy check will test connectivity to this URL instead of the + default test URLs. Only HTTP and HTTPS schemes are allowed, and the URL must + resolve to a public IP address. For ISP and datacenter proxies, the exit IP is + stable, so a successful check reliably indicates that subsequent browser + sessions will reach the target site with the same IP. For residential and mobile + proxies, the exit node changes between requests, so a successful check validates + proxy configuration but does not guarantee that a subsequent browser session + will use the same exit IP or reach the same site — it is useful for verifying + credentials and connectivity, not for predicting site-specific behavior. + """ diff --git a/tests/api_resources/test_proxies.py b/tests/api_resources/test_proxies.py index 9f107d2..fd8080e 100644 --- a/tests/api_resources/test_proxies.py +++ b/tests/api_resources/test_proxies.py @@ -184,7 +184,16 @@ def test_path_params_delete(self, client: Kernel) -> None: @parametrize def test_method_check(self, client: Kernel) -> None: proxy = client.proxies.check( - "id", + id="id", + ) + assert_matches_type(ProxyCheckResponse, proxy, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_check_with_all_params(self, client: Kernel) -> None: + proxy = client.proxies.check( + id="id", + url="url", ) assert_matches_type(ProxyCheckResponse, proxy, path=["response"]) @@ -192,7 +201,7 @@ def test_method_check(self, client: Kernel) -> None: @parametrize def test_raw_response_check(self, client: Kernel) -> None: response = client.proxies.with_raw_response.check( - "id", + id="id", ) assert response.is_closed is True @@ -204,7 +213,7 @@ def test_raw_response_check(self, client: Kernel) -> None: @parametrize def test_streaming_response_check(self, client: Kernel) -> None: with client.proxies.with_streaming_response.check( - "id", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -219,7 +228,7 @@ def test_streaming_response_check(self, client: Kernel) -> None: def test_path_params_check(self, client: Kernel) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.proxies.with_raw_response.check( - "", + id="", ) @@ -390,7 +399,16 @@ async def test_path_params_delete(self, async_client: AsyncKernel) -> None: @parametrize async def test_method_check(self, async_client: AsyncKernel) -> None: proxy = await async_client.proxies.check( - "id", + id="id", + ) + assert_matches_type(ProxyCheckResponse, proxy, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_check_with_all_params(self, async_client: AsyncKernel) -> None: + proxy = await async_client.proxies.check( + id="id", + url="url", ) assert_matches_type(ProxyCheckResponse, proxy, path=["response"]) @@ -398,7 +416,7 @@ async def test_method_check(self, async_client: AsyncKernel) -> None: @parametrize async def test_raw_response_check(self, async_client: AsyncKernel) -> None: response = await async_client.proxies.with_raw_response.check( - "id", + id="id", ) assert response.is_closed is True @@ -410,7 +428,7 @@ async def test_raw_response_check(self, async_client: AsyncKernel) -> None: @parametrize async def test_streaming_response_check(self, async_client: AsyncKernel) -> None: async with async_client.proxies.with_streaming_response.check( - "id", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -425,5 +443,5 @@ async def test_streaming_response_check(self, async_client: AsyncKernel) -> None async def test_path_params_check(self, async_client: AsyncKernel) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.proxies.with_raw_response.check( - "", + id="", ) From 1a455e041b3f08580c74382234b3483818d354f3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 18:48:47 +0000 Subject: [PATCH 3/3] release: 0.46.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/kernel/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index fc0d7ff..563004f 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/CHANGELOG.md b/CHANGELOG.md index 9a9e94e..c5ac20f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.46.0 (2026-04-06) + +Full Changelog: [v0.45.0...v0.46.0](https://github.com/kernel/kernel-python-sdk/compare/v0.45.0...v0.46.0) + +### Features + +* Add optional url parameter to proxy check endpoint ([cdd4b02](https://github.com/kernel/kernel-python-sdk/commit/cdd4b026fc01b1118cbc35cbc61890d15af3e021)) + ## 0.45.0 (2026-03-30) Full Changelog: [v0.44.0...v0.45.0](https://github.com/kernel/kernel-python-sdk/compare/v0.44.0...v0.45.0) diff --git a/pyproject.toml b/pyproject.toml index b8b563e..10ca20a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "kernel" -version = "0.45.0" +version = "0.46.0" 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 4483ae9..5b80010 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.45.0" # x-release-please-version +__version__ = "0.46.0" # x-release-please-version