22
33from __future__ import annotations
44
5+ import typing_extensions
56from typing import Mapping , Iterable , cast
67
78import httpx
@@ -161,7 +162,7 @@ def create(
161162 kiosk_mode: If true, launches the browser in kiosk mode to hide address bar and tabs in live
162163 view.
163164
164- persistence: Optional persistence configuration for the browser session .
165+ persistence: DEPRECATED: Use timeout_seconds (up to 72 hours) and Profiles instead .
165166
166167 profile: Profile selection for the browser session. Provide either id or name. If
167168 specified, the matching profile will be loaded into the browser session.
@@ -174,11 +175,10 @@ def create(
174175 mechanisms.
175176
176177 timeout_seconds: The number of seconds of inactivity before the browser session is terminated.
177- Only applicable to non-persistent browsers. Activity includes CDP connections
178- and live view connections. Defaults to 60 seconds. Minimum allowed is 10
179- seconds. Maximum allowed is 259200 (72 hours). We check for inactivity every 5
180- seconds, so the actual timeout behavior you will see is +/- 5 seconds around the
181- specified value.
178+ Activity includes CDP connections and live view connections. Defaults to 60
179+ seconds. Minimum allowed is 10 seconds. Maximum allowed is 259200 (72 hours). We
180+ check for inactivity every 5 seconds, so the actual timeout behavior you will
181+ see is +/- 5 seconds around the specified value.
182182
183183 viewport: Initial browser window size in pixels with optional refresh rate. If omitted,
184184 image defaults apply (commonly 1024x768@60). Only specific viewport
@@ -307,6 +307,7 @@ def list(
307307 model = BrowserListResponse ,
308308 )
309309
310+ @typing_extensions .deprecated ("deprecated" )
310311 def delete (
311312 self ,
312313 * ,
@@ -318,8 +319,10 @@ def delete(
318319 extra_body : Body | None = None ,
319320 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
320321 ) -> None :
321- """
322- Delete a persistent browser session by its persistent_id.
322+ """DEPRECATED: Use DELETE /browsers/{id} instead.
323+
324+ Delete a persistent browser
325+ session by its persistent_id.
323326
324327 Args:
325328 persistent_id: Persistent browser identifier
@@ -504,7 +507,7 @@ async def create(
504507 kiosk_mode: If true, launches the browser in kiosk mode to hide address bar and tabs in live
505508 view.
506509
507- persistence: Optional persistence configuration for the browser session .
510+ persistence: DEPRECATED: Use timeout_seconds (up to 72 hours) and Profiles instead .
508511
509512 profile: Profile selection for the browser session. Provide either id or name. If
510513 specified, the matching profile will be loaded into the browser session.
@@ -517,11 +520,10 @@ async def create(
517520 mechanisms.
518521
519522 timeout_seconds: The number of seconds of inactivity before the browser session is terminated.
520- Only applicable to non-persistent browsers. Activity includes CDP connections
521- and live view connections. Defaults to 60 seconds. Minimum allowed is 10
522- seconds. Maximum allowed is 259200 (72 hours). We check for inactivity every 5
523- seconds, so the actual timeout behavior you will see is +/- 5 seconds around the
524- specified value.
523+ Activity includes CDP connections and live view connections. Defaults to 60
524+ seconds. Minimum allowed is 10 seconds. Maximum allowed is 259200 (72 hours). We
525+ check for inactivity every 5 seconds, so the actual timeout behavior you will
526+ see is +/- 5 seconds around the specified value.
525527
526528 viewport: Initial browser window size in pixels with optional refresh rate. If omitted,
527529 image defaults apply (commonly 1024x768@60). Only specific viewport
@@ -650,6 +652,7 @@ def list(
650652 model = BrowserListResponse ,
651653 )
652654
655+ @typing_extensions .deprecated ("deprecated" )
653656 async def delete (
654657 self ,
655658 * ,
@@ -661,8 +664,10 @@ async def delete(
661664 extra_body : Body | None = None ,
662665 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
663666 ) -> None :
664- """
665- Delete a persistent browser session by its persistent_id.
667+ """DEPRECATED: Use DELETE /browsers/{id} instead.
668+
669+ Delete a persistent browser
670+ session by its persistent_id.
666671
667672 Args:
668673 persistent_id: Persistent browser identifier
@@ -784,8 +789,10 @@ def __init__(self, browsers: BrowsersResource) -> None:
784789 self .list = to_raw_response_wrapper (
785790 browsers .list ,
786791 )
787- self .delete = to_raw_response_wrapper (
788- browsers .delete ,
792+ self .delete = ( # pyright: ignore[reportDeprecated]
793+ to_raw_response_wrapper (
794+ browsers .delete , # pyright: ignore[reportDeprecated],
795+ )
789796 )
790797 self .delete_by_id = to_raw_response_wrapper (
791798 browsers .delete_by_id ,
@@ -832,8 +839,10 @@ def __init__(self, browsers: AsyncBrowsersResource) -> None:
832839 self .list = async_to_raw_response_wrapper (
833840 browsers .list ,
834841 )
835- self .delete = async_to_raw_response_wrapper (
836- browsers .delete ,
842+ self .delete = ( # pyright: ignore[reportDeprecated]
843+ async_to_raw_response_wrapper (
844+ browsers .delete , # pyright: ignore[reportDeprecated],
845+ )
837846 )
838847 self .delete_by_id = async_to_raw_response_wrapper (
839848 browsers .delete_by_id ,
@@ -880,8 +889,10 @@ def __init__(self, browsers: BrowsersResource) -> None:
880889 self .list = to_streamed_response_wrapper (
881890 browsers .list ,
882891 )
883- self .delete = to_streamed_response_wrapper (
884- browsers .delete ,
892+ self .delete = ( # pyright: ignore[reportDeprecated]
893+ to_streamed_response_wrapper (
894+ browsers .delete , # pyright: ignore[reportDeprecated],
895+ )
885896 )
886897 self .delete_by_id = to_streamed_response_wrapper (
887898 browsers .delete_by_id ,
@@ -928,8 +939,10 @@ def __init__(self, browsers: AsyncBrowsersResource) -> None:
928939 self .list = async_to_streamed_response_wrapper (
929940 browsers .list ,
930941 )
931- self .delete = async_to_streamed_response_wrapper (
932- browsers .delete ,
942+ self .delete = ( # pyright: ignore[reportDeprecated]
943+ async_to_streamed_response_wrapper (
944+ browsers .delete , # pyright: ignore[reportDeprecated],
945+ )
933946 )
934947 self .delete_by_id = async_to_streamed_response_wrapper (
935948 browsers .delete_by_id ,
0 commit comments