Skip to content

Commit 90ea00d

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#19)
1 parent b958c13 commit 90ea00d

File tree

5 files changed

+68
-58
lines changed

5 files changed

+68
-58
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-69e3c041b63edae61bddbb624edc185621be0ad4b1355395616ce08bc8d74ef9.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-0069ed71133ac7b0add07abd8562396c4b8e3c9a212e14a7586782eeed2ff373.yml

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

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

33
from __future__ import annotations
44

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

88
import httpx
@@ -104,7 +104,7 @@ def create(
104104
browser_settings: session_create_params.BrowserSettings | NotGiven = NOT_GIVEN,
105105
extension_id: str | NotGiven = NOT_GIVEN,
106106
keep_alive: bool | NotGiven = NOT_GIVEN,
107-
proxies: Union[bool, object] | NotGiven = NOT_GIVEN,
107+
proxies: Union[bool, Iterable[session_create_params.ProxiesUnionMember1]] | NotGiven = NOT_GIVEN,
108108
api_timeout: int | NotGiven = NOT_GIVEN,
109109
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
110110
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -354,7 +354,7 @@ async def create(
354354
browser_settings: session_create_params.BrowserSettings | NotGiven = NOT_GIVEN,
355355
extension_id: str | NotGiven = NOT_GIVEN,
356356
keep_alive: bool | NotGiven = NOT_GIVEN,
357-
proxies: Union[bool, object] | NotGiven = NOT_GIVEN,
357+
proxies: Union[bool, Iterable[session_create_params.ProxiesUnionMember1]] | NotGiven = NOT_GIVEN,
358358
api_timeout: int | NotGiven = NOT_GIVEN,
359359
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
360360
# The extra values given here take precedence over values defined on the client or passed to this method.

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

+2-7
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@
1212
class Extension(BaseModel):
1313
id: str
1414

15-
created_at: datetime
15+
created_at: datetime = FieldInfo(alias="createdAt")
1616

17-
file_name: str = FieldInfo(alias="fileName")
18-
19-
project_id: str = FieldInfo(alias="projectId")
20-
"""The Project ID linked to the uploaded Extension."""
21-
22-
updated_at: datetime
17+
updated_at: datetime = FieldInfo(alias="updatedAt")

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

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

3-
from typing import Optional
43
from datetime import datetime
5-
from typing_extensions import Literal
64

75
from pydantic import Field as FieldInfo
86

@@ -14,46 +12,6 @@
1412
class Session(BaseModel):
1513
id: str
1614

17-
created_at: datetime
15+
created_at: datetime = FieldInfo(alias="createdAt")
1816

19-
expires_at: datetime
20-
21-
keep_alive: bool
22-
"""Indicates if the Session was created to be kept alive upon disconnections"""
23-
24-
project_id: str
25-
"""The Project ID linked to the Session."""
26-
27-
proxy_bytes: int = FieldInfo(alias="proxyBytes")
28-
"""Bytes used via the [Proxy](/features/stealth-mode#proxies-and-residential-ips)"""
29-
30-
region: str
31-
32-
started_at: datetime
33-
34-
status: Literal["RUNNING", "ERROR", "TIMED_OUT", "COMPLETED"]
35-
36-
updated_at: datetime
37-
38-
avg_cpu_usage: Optional[int] = None
39-
"""CPU used by the Session"""
40-
41-
connect_url: Optional[str] = FieldInfo(alias="connectUrl", default=None)
42-
43-
context_id: Optional[str] = None
44-
"""Optional. The Context linked to the Session."""
45-
46-
ended_at: Optional[datetime] = None
47-
48-
is_idle: Optional[bool] = None
49-
50-
memory_usage: Optional[int] = None
51-
"""Memory used by the Session"""
52-
53-
selenium_remote_url: Optional[str] = FieldInfo(alias="seleniumRemoteUrl", default=None)
54-
55-
signing_key: Optional[str] = FieldInfo(alias="signingKey", default=None)
56-
57-
viewport_height: Optional[int] = None
58-
59-
viewport_width: Optional[int] = None
17+
updated_at: datetime = FieldInfo(alias="updatedAt")

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

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

33
from __future__ import annotations
44

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

88
from .._utils import PropertyInfo
99

@@ -14,6 +14,10 @@
1414
"BrowserSettingsFingerprint",
1515
"BrowserSettingsFingerprintScreen",
1616
"BrowserSettingsViewport",
17+
"ProxiesUnionMember1",
18+
"ProxiesUnionMember1BrowserbaseProxyConfig",
19+
"ProxiesUnionMember1BrowserbaseProxyConfigGeolocation",
20+
"ProxiesUnionMember1ExternalProxyConfig",
1721
]
1822

1923

@@ -38,7 +42,7 @@ class SessionCreateParams(TypedDict, total=False):
3842
This is available on the Startup plan only.
3943
"""
4044

41-
proxies: Union[bool, object]
45+
proxies: Union[bool, Iterable[ProxiesUnionMember1]]
4246
"""Proxy configuration.
4347
4448
Can be true for default proxy, or an array of proxy configurations.
@@ -127,3 +131,56 @@ class BrowserSettings(TypedDict, total=False):
127131
"""Enable or disable captcha solving in the browser. Defaults to `true`."""
128132

129133
viewport: BrowserSettingsViewport
134+
135+
136+
class ProxiesUnionMember1BrowserbaseProxyConfigGeolocation(TypedDict, total=False):
137+
country: Required[str]
138+
"""Country code in ISO 3166-1 alpha-2 format"""
139+
140+
city: str
141+
"""Name of the city. Use spaces for multi-word city names. Optional."""
142+
143+
state: str
144+
"""US state code (2 characters). Must also specify US as the country. Optional."""
145+
146+
147+
class ProxiesUnionMember1BrowserbaseProxyConfig(TypedDict, total=False):
148+
type: Required[Literal["browserbase"]]
149+
"""Type of proxy.
150+
151+
Always use 'browserbase' for the Browserbase managed proxy network.
152+
"""
153+
154+
domain_pattern: Annotated[str, PropertyInfo(alias="domainPattern")]
155+
"""Domain pattern for which this proxy should be used.
156+
157+
If omitted, defaults to all domains. Optional.
158+
"""
159+
160+
geolocation: ProxiesUnionMember1BrowserbaseProxyConfigGeolocation
161+
"""Configuration for geolocation"""
162+
163+
164+
class ProxiesUnionMember1ExternalProxyConfig(TypedDict, total=False):
165+
server: Required[str]
166+
"""Server URL for external proxy. Required."""
167+
168+
type: Required[Literal["external"]]
169+
"""Type of proxy. Always 'external' for this config."""
170+
171+
domain_pattern: Annotated[str, PropertyInfo(alias="domainPattern")]
172+
"""Domain pattern for which this proxy should be used.
173+
174+
If omitted, defaults to all domains. Optional.
175+
"""
176+
177+
password: str
178+
"""Password for external proxy authentication. Optional."""
179+
180+
username: str
181+
"""Username for external proxy authentication. Optional."""
182+
183+
184+
ProxiesUnionMember1: TypeAlias = Union[
185+
ProxiesUnionMember1BrowserbaseProxyConfig, ProxiesUnionMember1ExternalProxyConfig
186+
]

0 commit comments

Comments
 (0)