Skip to content

feat(api): api update #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 18
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-3b940292f5146d4659546ef49685da0a2877a622957e2cf48c6bc2ccf3c153ca.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-1e31d897af1fa5faba941e1170e9de8bbdbd169f84468a5554df02d807d2fa05.yml
18 changes: 16 additions & 2 deletions src/browserbase/resources/sessions/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ def update(
def list(
self,
*,
q: str | NotGiven = NOT_GIVEN,
status: Literal["RUNNING", "ERROR", "TIMED_OUT", "COMPLETED"] | 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.
Expand Down Expand Up @@ -281,7 +282,13 @@ def list(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"status": status}, session_list_params.SessionListParams),
query=maybe_transform(
{
"q": q,
"status": status,
},
session_list_params.SessionListParams,
),
),
cast_to=SessionListResponse,
)
Expand Down Expand Up @@ -512,6 +519,7 @@ async def update(
async def list(
self,
*,
q: str | NotGiven = NOT_GIVEN,
status: Literal["RUNNING", "ERROR", "TIMED_OUT", "COMPLETED"] | 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.
Expand Down Expand Up @@ -539,7 +547,13 @@ async def list(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform({"status": status}, session_list_params.SessionListParams),
query=await async_maybe_transform(
{
"q": q,
"status": status,
},
session_list_params.SessionListParams,
),
),
cast_to=SessionListResponse,
)
Expand Down
2 changes: 2 additions & 0 deletions src/browserbase/types/session_list_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@


class SessionListParams(TypedDict, total=False):
q: str

status: Literal["RUNNING", "ERROR", "TIMED_OUT", "COMPLETED"]
2 changes: 2 additions & 0 deletions tests/api_resources/test_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def test_method_list(self, client: Browserbase) -> None:
@parametrize
def test_method_list_with_all_params(self, client: Browserbase) -> None:
session = client.sessions.list(
q="q",
status="RUNNING",
)
assert_matches_type(SessionListResponse, session, path=["response"])
Expand Down Expand Up @@ -416,6 +417,7 @@ async def test_method_list(self, async_client: AsyncBrowserbase) -> None:
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncBrowserbase) -> None:
session = await async_client.sessions.list(
q="q",
status="RUNNING",
)
assert_matches_type(SessionListResponse, session, path=["response"])
Expand Down