From 52029c972bd9aa6f7d2d63f189c188913f935236 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 28 Oct 2024 01:19:28 +0000 Subject: [PATCH] feat(api): update via SDK Studio --- .stats.yml | 2 +- src/browserbase/resources/sessions/sessions.py | 10 ++++++++++ src/browserbase/types/session_create_params.py | 6 ++++++ tests/api_resources/test_sessions.py | 2 ++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b004f1b..743dc51 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 18 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-1ccf843d2efab92c6fa01ffb11a0b5e6787218d750597687de526ac9f22f6b81.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-3140ed9942ce873c477c950cc9a13ccce88c3b054b903cdf78ac0db6cf2c634f.yml diff --git a/src/browserbase/resources/sessions/sessions.py b/src/browserbase/resources/sessions/sessions.py index a2b8381..d298c01 100644 --- a/src/browserbase/resources/sessions/sessions.py +++ b/src/browserbase/resources/sessions/sessions.py @@ -106,6 +106,7 @@ def create( keep_alive: bool | NotGiven = NOT_GIVEN, proxies: object | NotGiven = NOT_GIVEN, region: Literal["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"] | NotGiven = NOT_GIVEN, + api_timeout: int | 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, @@ -132,6 +133,9 @@ def create( region: The region where the Session should run. + api_timeout: Duration in seconds after which the session will automatically end. Defaults to + the Project's `defaultTimeout`. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -150,6 +154,7 @@ def create( "keep_alive": keep_alive, "proxies": proxies, "region": region, + "timeout": api_timeout, }, session_create_params.SessionCreateParams, ), @@ -355,6 +360,7 @@ async def create( keep_alive: bool | NotGiven = NOT_GIVEN, proxies: object | NotGiven = NOT_GIVEN, region: Literal["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"] | NotGiven = NOT_GIVEN, + api_timeout: int | 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, @@ -381,6 +387,9 @@ async def create( region: The region where the Session should run. + api_timeout: Duration in seconds after which the session will automatically end. Defaults to + the Project's `defaultTimeout`. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -399,6 +408,7 @@ async def create( "keep_alive": keep_alive, "proxies": proxies, "region": region, + "timeout": api_timeout, }, session_create_params.SessionCreateParams, ), diff --git a/src/browserbase/types/session_create_params.py b/src/browserbase/types/session_create_params.py index 9b8d3b1..3b1920a 100644 --- a/src/browserbase/types/session_create_params.py +++ b/src/browserbase/types/session_create_params.py @@ -47,6 +47,12 @@ class SessionCreateParams(TypedDict, total=False): region: Literal["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"] """The region where the Session should run.""" + api_timeout: Annotated[int, PropertyInfo(alias="timeout")] + """Duration in seconds after which the session will automatically end. + + Defaults to the Project's `defaultTimeout`. + """ + class BrowserSettingsContext(TypedDict, total=False): id: Required[str] diff --git a/tests/api_resources/test_sessions.py b/tests/api_resources/test_sessions.py index 81c0f79..dadadd4 100644 --- a/tests/api_resources/test_sessions.py +++ b/tests/api_resources/test_sessions.py @@ -65,6 +65,7 @@ def test_method_create_with_all_params(self, client: Browserbase) -> None: keep_alive=True, proxies={}, region="us-west-2", + api_timeout=60, ) assert_matches_type(SessionCreateResponse, session, path=["response"]) @@ -293,6 +294,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncBrowserbas keep_alive=True, proxies={}, region="us-west-2", + api_timeout=60, ) assert_matches_type(SessionCreateResponse, session, path=["response"])