Skip to content

Commit faca7e9

Browse files
feat(api): api update (#109)
1 parent c97e138 commit faca7e9

File tree

7 files changed

+51
-21
lines changed

7 files changed

+51
-21
lines changed

Diff for: .stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 18
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-f1ba1f2c1512973c1640f7e2d27c72c4f5c49ec07e70b026d52818e7f8b1468e.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-6a5cbe2f816042d594335d77f9600cd47cdb9c21d9d60971a2eca87983061c72.yml

Diff for: src/browserbase/resources/sessions/sessions.py

+21-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Union, Iterable
5+
from typing import Dict, Union, Iterable
66
from typing_extensions import Literal
77

88
import httpx
@@ -108,7 +108,7 @@ def create(
108108
proxies: Union[bool, Iterable[session_create_params.ProxiesUnionMember1]] | NotGiven = NOT_GIVEN,
109109
region: Literal["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"] | NotGiven = NOT_GIVEN,
110110
api_timeout: int | NotGiven = NOT_GIVEN,
111-
user_metadata: object | NotGiven = NOT_GIVEN,
111+
user_metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
112112
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
113113
# The extra values given here take precedence over values defined on the client or passed to this method.
114114
extra_headers: Headers | None = None,
@@ -138,7 +138,8 @@ def create(
138138
api_timeout: Duration in seconds after which the session will automatically end. Defaults to
139139
the Project's `defaultTimeout`.
140140
141-
user_metadata: Arbitrary user metadata to attach to the session.
141+
user_metadata: Arbitrary user metadata to attach to the session. To learn more about user
142+
metadata, see [User Metadata](/features/sessions#user-metadata).
142143
143144
extra_headers: Send extra headers
144145
@@ -263,10 +264,15 @@ def list(
263264
extra_body: Body | None = None,
264265
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
265266
) -> SessionListResponse:
266-
"""
267-
List Sessions
267+
"""List Sessions
268268
269269
Args:
270+
q: Query sessions by user metadata.
271+
272+
See
273+
[Querying Sessions by User Metadata](/features/sessions#querying-sessions-by-user-metadata)
274+
for the schema of this query.
275+
270276
extra_headers: Send extra headers
271277
272278
extra_query: Add additional query parameters to the request
@@ -373,7 +379,7 @@ async def create(
373379
proxies: Union[bool, Iterable[session_create_params.ProxiesUnionMember1]] | NotGiven = NOT_GIVEN,
374380
region: Literal["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"] | NotGiven = NOT_GIVEN,
375381
api_timeout: int | NotGiven = NOT_GIVEN,
376-
user_metadata: object | NotGiven = NOT_GIVEN,
382+
user_metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
377383
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
378384
# The extra values given here take precedence over values defined on the client or passed to this method.
379385
extra_headers: Headers | None = None,
@@ -403,7 +409,8 @@ async def create(
403409
api_timeout: Duration in seconds after which the session will automatically end. Defaults to
404410
the Project's `defaultTimeout`.
405411
406-
user_metadata: Arbitrary user metadata to attach to the session.
412+
user_metadata: Arbitrary user metadata to attach to the session. To learn more about user
413+
metadata, see [User Metadata](/features/sessions#user-metadata).
407414
408415
extra_headers: Send extra headers
409416
@@ -528,10 +535,15 @@ async def list(
528535
extra_body: Body | None = None,
529536
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
530537
) -> SessionListResponse:
531-
"""
532-
List Sessions
538+
"""List Sessions
533539
534540
Args:
541+
q: Query sessions by user metadata.
542+
543+
See
544+
[Querying Sessions by User Metadata](/features/sessions#querying-sessions-by-user-metadata)
545+
for the schema of this query.
546+
535547
extra_headers: Send extra headers
536548
537549
extra_query: Add additional query parameters to the request

Diff for: src/browserbase/types/session.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Optional
3+
from typing import Dict, Optional
44
from datetime import datetime
55
from typing_extensions import Literal
66

@@ -47,5 +47,9 @@ class Session(BaseModel):
4747
memory_usage: Optional[int] = FieldInfo(alias="memoryUsage", default=None)
4848
"""Memory used by the Session"""
4949

50-
user_metadata: Optional[object] = FieldInfo(alias="userMetadata", default=None)
51-
"""Arbitrary user metadata to attach to the session."""
50+
user_metadata: Optional[Dict[str, object]] = FieldInfo(alias="userMetadata", default=None)
51+
"""Arbitrary user metadata to attach to the session.
52+
53+
To learn more about user metadata, see
54+
[User Metadata](/features/sessions#user-metadata).
55+
"""

Diff for: src/browserbase/types/session_create_params.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Union, Iterable
5+
from typing import Dict, List, Union, Iterable
66
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
77

88
from .._utils import PropertyInfo
@@ -57,8 +57,12 @@ class SessionCreateParams(TypedDict, total=False):
5757
Defaults to the Project's `defaultTimeout`.
5858
"""
5959

60-
user_metadata: Annotated[object, PropertyInfo(alias="userMetadata")]
61-
"""Arbitrary user metadata to attach to the session."""
60+
user_metadata: Annotated[Dict[str, object], PropertyInfo(alias="userMetadata")]
61+
"""Arbitrary user metadata to attach to the session.
62+
63+
To learn more about user metadata, see
64+
[User Metadata](/features/sessions#user-metadata).
65+
"""
6266

6367

6468
class BrowserSettingsContext(TypedDict, total=False):

Diff for: src/browserbase/types/session_create_response.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Optional
3+
from typing import Dict, Optional
44
from datetime import datetime
55
from typing_extensions import Literal
66

@@ -56,5 +56,9 @@ class SessionCreateResponse(BaseModel):
5656
memory_usage: Optional[int] = FieldInfo(alias="memoryUsage", default=None)
5757
"""Memory used by the Session"""
5858

59-
user_metadata: Optional[object] = FieldInfo(alias="userMetadata", default=None)
60-
"""Arbitrary user metadata to attach to the session."""
59+
user_metadata: Optional[Dict[str, object]] = FieldInfo(alias="userMetadata", default=None)
60+
"""Arbitrary user metadata to attach to the session.
61+
62+
To learn more about user metadata, see
63+
[User Metadata](/features/sessions#user-metadata).
64+
"""

Diff for: src/browserbase/types/session_list_params.py

+6
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,11 @@
99

1010
class SessionListParams(TypedDict, total=False):
1111
q: str
12+
"""Query sessions by user metadata.
13+
14+
See
15+
[Querying Sessions by User Metadata](/features/sessions#querying-sessions-by-user-metadata)
16+
for the schema of this query.
17+
"""
1218

1319
status: Literal["RUNNING", "ERROR", "TIMED_OUT", "COMPLETED"]

Diff for: tests/api_resources/test_sessions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def test_method_create_with_all_params(self, client: Browserbase) -> None:
6767
proxies=True,
6868
region="us-west-2",
6969
api_timeout=60,
70-
user_metadata={},
70+
user_metadata={"foo": "bar"},
7171
)
7272
assert_matches_type(SessionCreateResponse, session, path=["response"])
7373

@@ -299,7 +299,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncBrowserbas
299299
proxies=True,
300300
region="us-west-2",
301301
api_timeout=60,
302-
user_metadata={},
302+
user_metadata={"foo": "bar"},
303303
)
304304
assert_matches_type(SessionCreateResponse, session, path=["response"])
305305

0 commit comments

Comments
 (0)