diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6772f01..6f257c8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.71.0" + ".": "0.72.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index ef32d38..10d9022 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 124 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-4fb45d71a99648425c84bdc8e5780920105cede4ee2d4eac67276d0609ac1e94.yml -openapi_spec_hash: 1f04cb5b36e92db81dfa264c2a59c32a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-4c243ff089133bd49322d98a6943647589972f71ecadc993fe9e5029972b3995.yml +openapi_spec_hash: a2cb637a19a070d07a1a4343c75444ee config_hash: fb167e754ebb3a14649463725891c9d0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 35090e2..ab94a97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.72.0 (2026-06-26) + +Full Changelog: [v0.71.0...v0.72.0](https://github.com/kernel/kernel-python-sdk/compare/v0.71.0...v0.72.0) + +### Bug Fixes + +* **api:** browser pool profile omits save_changes (BrowserPoolProfile) ([34423fb](https://github.com/kernel/kernel-python-sdk/commit/34423fb99af7f43b7b9a6a023a4ec85902b1bcb2)) + ## 0.71.0 (2026-06-26) Full Changelog: [v0.70.0...v0.71.0](https://github.com/kernel/kernel-python-sdk/compare/v0.70.0...v0.71.0) diff --git a/pyproject.toml b/pyproject.toml index 9187ed7..1649ada 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "kernel" -version = "0.71.0" +version = "0.72.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 0bf9994..4584cbe 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.71.0" # x-release-please-version +__version__ = "0.72.0" # x-release-please-version diff --git a/src/kernel/resources/browser_pools.py b/src/kernel/resources/browser_pools.py index 019489f..842d3ec 100644 --- a/src/kernel/resources/browser_pools.py +++ b/src/kernel/resources/browser_pools.py @@ -29,7 +29,6 @@ from ..types.tags_param import TagsParam from ..types.browser_pool import BrowserPool from ..types.browser_pool_acquire_response import BrowserPoolAcquireResponse -from ..types.shared_params.browser_profile import BrowserProfile from ..types.shared_params.browser_viewport import BrowserViewport from ..types.shared_params.browser_extension import BrowserExtension @@ -68,7 +67,7 @@ def create( headless: bool | Omit = omit, kiosk_mode: bool | Omit = omit, name: str | Omit = omit, - profile: BrowserProfile | Omit = omit, + profile: browser_pool_create_params.Profile | Omit = omit, proxy_id: str | Omit = omit, start_url: str | Omit = omit, stealth: bool | Omit = omit, @@ -81,8 +80,12 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BrowserPool: - """ - Create a new browser pool with the specified configuration and size. + """Create a new browser pool with the specified configuration and size. + + Pooled + browsers load their profile read-only: any save_changes on the profile is + ignored (not rejected), so pooled browsers never persist changes back to the + profile. Args: size: Number of browsers to maintain in the pool. The maximum size is determined by @@ -107,9 +110,12 @@ def create( name: Optional name for the browser pool. Must be unique within the project. - profile: Profile selection for the browser session. Provide either id or name. If - specified, the matching profile will be loaded into the browser session. - Profiles must be created beforehand. + profile: Profile selection for browsers in a pool. Provide either id or name. The + matching profile is loaded into every browser in the pool. Profiles must be + created beforehand. Unlike single browser sessions, pools load the profile + read-only and never persist changes back to it, so save_changes is omitted here. + Any save_changes value sent on a pool profile is silently ignored rather than + rejected, so callers reusing a single-session profile object will not error. proxy_id: Optional proxy to associate to the browser session. Must reference a proxy in the same project as the browser session. @@ -217,7 +223,7 @@ def update( headless: bool | Omit = omit, kiosk_mode: bool | Omit = omit, name: str | Omit = omit, - profile: BrowserProfile | Omit = omit, + profile: browser_pool_update_params.Profile | Omit = omit, proxy_id: str | Omit = omit, size: int | Omit = omit, start_url: str | Omit = omit, @@ -231,8 +237,11 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BrowserPool: - """ - Updates the configuration used to create browsers in the pool. + """Updates the configuration used to create browsers in the pool. + + As with creation, + save_changes on the pool profile is ignored (not rejected); pooled browsers + never persist changes back to the profile. Args: chrome_policy: Custom Chrome enterprise policy overrides applied to all browsers in this pool. @@ -256,9 +265,12 @@ def update( name: Optional name for the browser pool. Must be unique within the project. - profile: Profile selection for the browser session. Provide either id or name. If - specified, the matching profile will be loaded into the browser session. - Profiles must be created beforehand. + profile: Profile selection for browsers in a pool. Provide either id or name. The + matching profile is loaded into every browser in the pool. Profiles must be + created beforehand. Unlike single browser sessions, pools load the profile + read-only and never persist changes back to it, so save_changes is omitted here. + Any save_changes value sent on a pool profile is silently ignored rather than + rejected, so callers reusing a single-session profile object will not error. proxy_id: Optional proxy to associate to the browser session. Must reference a proxy in the same project as the browser session. @@ -603,7 +615,7 @@ async def create( headless: bool | Omit = omit, kiosk_mode: bool | Omit = omit, name: str | Omit = omit, - profile: BrowserProfile | Omit = omit, + profile: browser_pool_create_params.Profile | Omit = omit, proxy_id: str | Omit = omit, start_url: str | Omit = omit, stealth: bool | Omit = omit, @@ -616,8 +628,12 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BrowserPool: - """ - Create a new browser pool with the specified configuration and size. + """Create a new browser pool with the specified configuration and size. + + Pooled + browsers load their profile read-only: any save_changes on the profile is + ignored (not rejected), so pooled browsers never persist changes back to the + profile. Args: size: Number of browsers to maintain in the pool. The maximum size is determined by @@ -642,9 +658,12 @@ async def create( name: Optional name for the browser pool. Must be unique within the project. - profile: Profile selection for the browser session. Provide either id or name. If - specified, the matching profile will be loaded into the browser session. - Profiles must be created beforehand. + profile: Profile selection for browsers in a pool. Provide either id or name. The + matching profile is loaded into every browser in the pool. Profiles must be + created beforehand. Unlike single browser sessions, pools load the profile + read-only and never persist changes back to it, so save_changes is omitted here. + Any save_changes value sent on a pool profile is silently ignored rather than + rejected, so callers reusing a single-session profile object will not error. proxy_id: Optional proxy to associate to the browser session. Must reference a proxy in the same project as the browser session. @@ -752,7 +771,7 @@ async def update( headless: bool | Omit = omit, kiosk_mode: bool | Omit = omit, name: str | Omit = omit, - profile: BrowserProfile | Omit = omit, + profile: browser_pool_update_params.Profile | Omit = omit, proxy_id: str | Omit = omit, size: int | Omit = omit, start_url: str | Omit = omit, @@ -766,8 +785,11 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BrowserPool: - """ - Updates the configuration used to create browsers in the pool. + """Updates the configuration used to create browsers in the pool. + + As with creation, + save_changes on the pool profile is ignored (not rejected); pooled browsers + never persist changes back to the profile. Args: chrome_policy: Custom Chrome enterprise policy overrides applied to all browsers in this pool. @@ -791,9 +813,12 @@ async def update( name: Optional name for the browser pool. Must be unique within the project. - profile: Profile selection for the browser session. Provide either id or name. If - specified, the matching profile will be loaded into the browser session. - Profiles must be created beforehand. + profile: Profile selection for browsers in a pool. Provide either id or name. The + matching profile is loaded into every browser in the pool. Profiles must be + created beforehand. Unlike single browser sessions, pools load the profile + read-only and never persist changes back to it, so save_changes is omitted here. + Any save_changes value sent on a pool profile is silently ignored rather than + rejected, so callers reusing a single-session profile object will not error. proxy_id: Optional proxy to associate to the browser session. Must reference a proxy in the same project as the browser session. diff --git a/src/kernel/types/browser_pool.py b/src/kernel/types/browser_pool.py index 877fbcd..6bceffe 100644 --- a/src/kernel/types/browser_pool.py +++ b/src/kernel/types/browser_pool.py @@ -4,11 +4,30 @@ from datetime import datetime from .._models import BaseModel -from .shared.browser_profile import BrowserProfile from .shared.browser_viewport import BrowserViewport from .shared.browser_extension import BrowserExtension -__all__ = ["BrowserPool", "BrowserPoolConfig"] +__all__ = ["BrowserPool", "BrowserPoolConfig", "BrowserPoolConfigProfile"] + + +class BrowserPoolConfigProfile(BaseModel): + """Profile selection for browsers in a pool. + + Provide either id or name. The matching profile is + loaded into every browser in the pool. Profiles must be created beforehand. Unlike single + browser sessions, pools load the profile read-only and never persist changes back to it, so + save_changes is omitted here. Any save_changes value sent on a pool profile is silently + ignored rather than rejected, so callers reusing a single-session profile object will not error. + """ + + id: Optional[str] = None + """Profile ID to load for browsers in this pool""" + + name: Optional[str] = None + """Profile name to load for browsers in this pool (instead of id). + + Must be 1-255 characters, using letters, numbers, dots, underscores, or hyphens. + """ class BrowserPoolConfig(BaseModel): @@ -54,11 +73,15 @@ class BrowserPoolConfig(BaseModel): name: Optional[str] = None """Optional name for the browser pool. Must be unique within the project.""" - profile: Optional[BrowserProfile] = None - """Profile selection for the browser session. + profile: Optional[BrowserPoolConfigProfile] = None + """Profile selection for browsers in a pool. - Provide either id or name. If specified, the matching profile will be loaded - into the browser session. Profiles must be created beforehand. + Provide either id or name. The matching profile is loaded into every browser in + the pool. Profiles must be created beforehand. Unlike single browser sessions, + pools load the profile read-only and never persist changes back to it, so + save_changes is omitted here. Any save_changes value sent on a pool profile is + silently ignored rather than rejected, so callers reusing a single-session + profile object will not error. """ proxy_id: Optional[str] = None diff --git a/src/kernel/types/browser_pool_create_params.py b/src/kernel/types/browser_pool_create_params.py index d404d4e..f629691 100644 --- a/src/kernel/types/browser_pool_create_params.py +++ b/src/kernel/types/browser_pool_create_params.py @@ -5,11 +5,10 @@ from typing import Dict, Iterable from typing_extensions import Required, TypedDict -from .shared_params.browser_profile import BrowserProfile from .shared_params.browser_viewport import BrowserViewport from .shared_params.browser_extension import BrowserExtension -__all__ = ["BrowserPoolCreateParams"] +__all__ = ["BrowserPoolCreateParams", "Profile"] class BrowserPoolCreateParams(TypedDict, total=False): @@ -53,11 +52,15 @@ class BrowserPoolCreateParams(TypedDict, total=False): name: str """Optional name for the browser pool. Must be unique within the project.""" - profile: BrowserProfile - """Profile selection for the browser session. + profile: Profile + """Profile selection for browsers in a pool. - Provide either id or name. If specified, the matching profile will be loaded - into the browser session. Profiles must be created beforehand. + Provide either id or name. The matching profile is loaded into every browser in + the pool. Profiles must be created beforehand. Unlike single browser sessions, + pools load the profile read-only and never persist changes back to it, so + save_changes is omitted here. Any save_changes value sent on a pool profile is + silently ignored rather than rejected, so callers reusing a single-session + profile object will not error. """ proxy_id: str @@ -102,3 +105,23 @@ class BrowserPoolCreateParams(TypedDict, total=False): based on the resolution (higher resolutions use lower refresh rates to keep bandwidth reasonable). """ + + +class Profile(TypedDict, total=False): + """Profile selection for browsers in a pool. + + Provide either id or name. The matching profile is + loaded into every browser in the pool. Profiles must be created beforehand. Unlike single + browser sessions, pools load the profile read-only and never persist changes back to it, so + save_changes is omitted here. Any save_changes value sent on a pool profile is silently + ignored rather than rejected, so callers reusing a single-session profile object will not error. + """ + + id: str + """Profile ID to load for browsers in this pool""" + + name: str + """Profile name to load for browsers in this pool (instead of id). + + Must be 1-255 characters, using letters, numbers, dots, underscores, or hyphens. + """ diff --git a/src/kernel/types/browser_pool_update_params.py b/src/kernel/types/browser_pool_update_params.py index 79e8172..2688f23 100644 --- a/src/kernel/types/browser_pool_update_params.py +++ b/src/kernel/types/browser_pool_update_params.py @@ -5,11 +5,10 @@ from typing import Dict, Iterable from typing_extensions import TypedDict -from .shared_params.browser_profile import BrowserProfile from .shared_params.browser_viewport import BrowserViewport from .shared_params.browser_extension import BrowserExtension -__all__ = ["BrowserPoolUpdateParams"] +__all__ = ["BrowserPoolUpdateParams", "Profile"] class BrowserPoolUpdateParams(TypedDict, total=False): @@ -52,11 +51,15 @@ class BrowserPoolUpdateParams(TypedDict, total=False): name: str """Optional name for the browser pool. Must be unique within the project.""" - profile: BrowserProfile - """Profile selection for the browser session. + profile: Profile + """Profile selection for browsers in a pool. - Provide either id or name. If specified, the matching profile will be loaded - into the browser session. Profiles must be created beforehand. + Provide either id or name. The matching profile is loaded into every browser in + the pool. Profiles must be created beforehand. Unlike single browser sessions, + pools load the profile read-only and never persist changes back to it, so + save_changes is omitted here. Any save_changes value sent on a pool profile is + silently ignored rather than rejected, so callers reusing a single-session + profile object will not error. """ proxy_id: str @@ -108,3 +111,23 @@ class BrowserPoolUpdateParams(TypedDict, total=False): based on the resolution (higher resolutions use lower refresh rates to keep bandwidth reasonable). """ + + +class Profile(TypedDict, total=False): + """Profile selection for browsers in a pool. + + Provide either id or name. The matching profile is + loaded into every browser in the pool. Profiles must be created beforehand. Unlike single + browser sessions, pools load the profile read-only and never persist changes back to it, so + save_changes is omitted here. Any save_changes value sent on a pool profile is silently + ignored rather than rejected, so callers reusing a single-session profile object will not error. + """ + + id: str + """Profile ID to load for browsers in this pool""" + + name: str + """Profile name to load for browsers in this pool (instead of id). + + Must be 1-255 characters, using letters, numbers, dots, underscores, or hyphens. + """ diff --git a/tests/api_resources/test_browser_pools.py b/tests/api_resources/test_browser_pools.py index ba603e7..c7e8bdb 100644 --- a/tests/api_resources/test_browser_pools.py +++ b/tests/api_resources/test_browser_pools.py @@ -48,7 +48,6 @@ def test_method_create_with_all_params(self, client: Kernel) -> None: profile={ "id": "id", "name": "name", - "save_changes": True, }, proxy_id="proxy_id", start_url="https://example.com", @@ -158,7 +157,6 @@ def test_method_update_with_all_params(self, client: Kernel) -> None: profile={ "id": "id", "name": "name", - "save_changes": True, }, proxy_id="proxy_id", size=10, @@ -484,7 +482,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncKernel) -> profile={ "id": "id", "name": "name", - "save_changes": True, }, proxy_id="proxy_id", start_url="https://example.com", @@ -594,7 +591,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncKernel) -> profile={ "id": "id", "name": "name", - "save_changes": True, }, proxy_id="proxy_id", size=10,