2
2
3
3
from __future__ import annotations
4
4
5
- from typing import List
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
7
7
8
8
from .._utils import PropertyInfo
9
9
14
14
"BrowserSettingsFingerprint" ,
15
15
"BrowserSettingsFingerprintScreen" ,
16
16
"BrowserSettingsViewport" ,
17
+ "ProxiesUnionMember1" ,
18
+ "ProxiesUnionMember1BrowserbaseProxyConfig" ,
19
+ "ProxiesUnionMember1BrowserbaseProxyConfigGeolocation" ,
20
+ "ProxiesUnionMember1ExternalProxyConfig" ,
17
21
]
18
22
19
23
@@ -38,7 +42,7 @@ class SessionCreateParams(TypedDict, total=False):
38
42
This is available on the Startup plan only.
39
43
"""
40
44
41
- proxies : object
45
+ proxies : Union [ bool , Iterable [ ProxiesUnionMember1 ]]
42
46
"""Proxy configuration.
43
47
44
48
Can be true for default proxy, or an array of proxy configurations.
@@ -130,3 +134,56 @@ class BrowserSettings(TypedDict, total=False):
130
134
"""Enable or disable captcha solving in the browser. Defaults to `true`."""
131
135
132
136
viewport : BrowserSettingsViewport
137
+
138
+
139
+ class ProxiesUnionMember1BrowserbaseProxyConfigGeolocation (TypedDict , total = False ):
140
+ country : Required [str ]
141
+ """Country code in ISO 3166-1 alpha-2 format"""
142
+
143
+ city : str
144
+ """Name of the city. Use spaces for multi-word city names. Optional."""
145
+
146
+ state : str
147
+ """US state code (2 characters). Must also specify US as the country. Optional."""
148
+
149
+
150
+ class ProxiesUnionMember1BrowserbaseProxyConfig (TypedDict , total = False ):
151
+ type : Required [Literal ["browserbase" ]]
152
+ """Type of proxy.
153
+
154
+ Always use 'browserbase' for the Browserbase managed proxy network.
155
+ """
156
+
157
+ domain_pattern : Annotated [str , PropertyInfo (alias = "domainPattern" )]
158
+ """Domain pattern for which this proxy should be used.
159
+
160
+ If omitted, defaults to all domains. Optional.
161
+ """
162
+
163
+ geolocation : ProxiesUnionMember1BrowserbaseProxyConfigGeolocation
164
+ """Configuration for geolocation"""
165
+
166
+
167
+ class ProxiesUnionMember1ExternalProxyConfig (TypedDict , total = False ):
168
+ server : Required [str ]
169
+ """Server URL for external proxy. Required."""
170
+
171
+ type : Required [Literal ["external" ]]
172
+ """Type of proxy. Always 'external' for this config."""
173
+
174
+ domain_pattern : Annotated [str , PropertyInfo (alias = "domainPattern" )]
175
+ """Domain pattern for which this proxy should be used.
176
+
177
+ If omitted, defaults to all domains. Optional.
178
+ """
179
+
180
+ password : str
181
+ """Password for external proxy authentication. Optional."""
182
+
183
+ username : str
184
+ """Username for external proxy authentication. Optional."""
185
+
186
+
187
+ ProxiesUnionMember1 : TypeAlias = Union [
188
+ ProxiesUnionMember1BrowserbaseProxyConfig , ProxiesUnionMember1ExternalProxyConfig
189
+ ]
0 commit comments