diff --git a/.stats.yml b/.stats.yml index d42b050..b76e3ec 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-7f88912695bab2b98cb73137e6f36125d02fdfaf8eed4532ee1c82385609a259.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-3b940292f5146d4659546ef49685da0a2877a622957e2cf48c6bc2ccf3c153ca.yml diff --git a/src/browserbase/resources/sessions/sessions.py b/src/browserbase/resources/sessions/sessions.py index 15d8e70..513b6c2 100644 --- a/src/browserbase/resources/sessions/sessions.py +++ b/src/browserbase/resources/sessions/sessions.py @@ -108,6 +108,7 @@ def create( proxies: Union[bool, Iterable[session_create_params.ProxiesUnionMember1]] | 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, + user_metadata: object | 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, @@ -137,6 +138,8 @@ def create( api_timeout: Duration in seconds after which the session will automatically end. Defaults to the Project's `defaultTimeout`. + user_metadata: Arbitrary user metadata to attach to the session. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -156,6 +159,7 @@ def create( "proxies": proxies, "region": region, "api_timeout": api_timeout, + "user_metadata": user_metadata, }, session_create_params.SessionCreateParams, ), @@ -362,6 +366,7 @@ async def create( proxies: Union[bool, Iterable[session_create_params.ProxiesUnionMember1]] | 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, + user_metadata: object | 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, @@ -391,6 +396,8 @@ async def create( api_timeout: Duration in seconds after which the session will automatically end. Defaults to the Project's `defaultTimeout`. + user_metadata: Arbitrary user metadata to attach to the session. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -410,6 +417,7 @@ async def create( "proxies": proxies, "region": region, "api_timeout": api_timeout, + "user_metadata": user_metadata, }, session_create_params.SessionCreateParams, ), diff --git a/src/browserbase/types/session.py b/src/browserbase/types/session.py index 8bd47f9..eb9994e 100644 --- a/src/browserbase/types/session.py +++ b/src/browserbase/types/session.py @@ -46,3 +46,6 @@ class Session(BaseModel): memory_usage: Optional[int] = FieldInfo(alias="memoryUsage", default=None) """Memory used by the Session""" + + user_metadata: Optional[object] = FieldInfo(alias="userMetadata", default=None) + """Arbitrary user metadata to attach to the session.""" diff --git a/src/browserbase/types/session_create_params.py b/src/browserbase/types/session_create_params.py index bd643b3..b026c9f 100644 --- a/src/browserbase/types/session_create_params.py +++ b/src/browserbase/types/session_create_params.py @@ -57,6 +57,9 @@ class SessionCreateParams(TypedDict, total=False): Defaults to the Project's `defaultTimeout`. """ + user_metadata: Annotated[object, PropertyInfo(alias="userMetadata")] + """Arbitrary user metadata to attach to the session.""" + class BrowserSettingsContext(TypedDict, total=False): id: Required[str] diff --git a/src/browserbase/types/session_create_response.py b/src/browserbase/types/session_create_response.py index 8c9ae09..5bd9443 100644 --- a/src/browserbase/types/session_create_response.py +++ b/src/browserbase/types/session_create_response.py @@ -55,3 +55,6 @@ class SessionCreateResponse(BaseModel): memory_usage: Optional[int] = FieldInfo(alias="memoryUsage", default=None) """Memory used by the Session""" + + user_metadata: Optional[object] = FieldInfo(alias="userMetadata", default=None) + """Arbitrary user metadata to attach to the session.""" diff --git a/src/browserbase/types/sessions/session_log.py b/src/browserbase/types/sessions/session_log.py index d15eb83..af58030 100644 --- a/src/browserbase/types/sessions/session_log.py +++ b/src/browserbase/types/sessions/session_log.py @@ -28,8 +28,6 @@ class Response(BaseModel): class SessionLog(BaseModel): - event_id: str = FieldInfo(alias="eventId") - method: str page_id: int = FieldInfo(alias="pageId") diff --git a/tests/api_resources/test_sessions.py b/tests/api_resources/test_sessions.py index 7b9fbce..6378f27 100644 --- a/tests/api_resources/test_sessions.py +++ b/tests/api_resources/test_sessions.py @@ -66,6 +66,7 @@ def test_method_create_with_all_params(self, client: Browserbase) -> None: proxies=True, region="us-west-2", api_timeout=60, + user_metadata={}, ) assert_matches_type(SessionCreateResponse, session, path=["response"]) @@ -295,6 +296,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncBrowserbas proxies=True, region="us-west-2", api_timeout=60, + user_metadata={}, ) assert_matches_type(SessionCreateResponse, session, path=["response"])