2
2
3
3
from __future__ import annotations
4
4
5
- from typing import Union , Iterable
6
5
from typing_extensions import Literal
7
6
8
7
import httpx
57
56
from ...types .session import Session
58
57
from ...types .session_live_urls import SessionLiveURLs
59
58
from ...types .session_list_response import SessionListResponse
59
+ from ...types .session_create_response import SessionCreateResponse
60
60
61
61
__all__ = ["SessionsResource" , "AsyncSessionsResource" ]
62
62
@@ -104,15 +104,16 @@ def create(
104
104
browser_settings : session_create_params .BrowserSettings | NotGiven = NOT_GIVEN ,
105
105
extension_id : str | NotGiven = NOT_GIVEN ,
106
106
keep_alive : bool | NotGiven = NOT_GIVEN ,
107
- proxies : Union [bool , Iterable [session_create_params .ProxiesUnionMember1 ]] | NotGiven = NOT_GIVEN ,
107
+ proxies : object | NotGiven = NOT_GIVEN ,
108
+ region : Literal ["us-west-2" , "us-east-1" , "eu-central-1" , "ap-southeast-1" ] | NotGiven = NOT_GIVEN ,
108
109
api_timeout : int | NotGiven = NOT_GIVEN ,
109
110
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
110
111
# The extra values given here take precedence over values defined on the client or passed to this method.
111
112
extra_headers : Headers | None = None ,
112
113
extra_query : Query | None = None ,
113
114
extra_body : Body | None = None ,
114
115
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
115
- ) -> Session :
116
+ ) -> SessionCreateResponse :
116
117
"""Create a Session
117
118
118
119
Args:
@@ -130,6 +131,8 @@ def create(
130
131
proxies: Proxy configuration. Can be true for default proxy, or an array of proxy
131
132
configurations.
132
133
134
+ region: The region where the Session should run.
135
+
133
136
api_timeout: Duration in seconds after which the session will automatically end. Defaults to
134
137
the Project's `defaultTimeout`.
135
138
@@ -150,14 +153,15 @@ def create(
150
153
"extension_id" : extension_id ,
151
154
"keep_alive" : keep_alive ,
152
155
"proxies" : proxies ,
156
+ "region" : region ,
153
157
"timeout" : api_timeout ,
154
158
},
155
159
session_create_params .SessionCreateParams ,
156
160
),
157
161
options = make_request_options (
158
162
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
159
163
),
160
- cast_to = Session ,
164
+ cast_to = SessionCreateResponse ,
161
165
)
162
166
163
167
def retrieve (
@@ -354,15 +358,16 @@ async def create(
354
358
browser_settings : session_create_params .BrowserSettings | NotGiven = NOT_GIVEN ,
355
359
extension_id : str | NotGiven = NOT_GIVEN ,
356
360
keep_alive : bool | NotGiven = NOT_GIVEN ,
357
- proxies : Union [bool , Iterable [session_create_params .ProxiesUnionMember1 ]] | NotGiven = NOT_GIVEN ,
361
+ proxies : object | NotGiven = NOT_GIVEN ,
362
+ region : Literal ["us-west-2" , "us-east-1" , "eu-central-1" , "ap-southeast-1" ] | NotGiven = NOT_GIVEN ,
358
363
api_timeout : int | NotGiven = NOT_GIVEN ,
359
364
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
360
365
# The extra values given here take precedence over values defined on the client or passed to this method.
361
366
extra_headers : Headers | None = None ,
362
367
extra_query : Query | None = None ,
363
368
extra_body : Body | None = None ,
364
369
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
365
- ) -> Session :
370
+ ) -> SessionCreateResponse :
366
371
"""Create a Session
367
372
368
373
Args:
@@ -380,6 +385,8 @@ async def create(
380
385
proxies: Proxy configuration. Can be true for default proxy, or an array of proxy
381
386
configurations.
382
387
388
+ region: The region where the Session should run.
389
+
383
390
api_timeout: Duration in seconds after which the session will automatically end. Defaults to
384
391
the Project's `defaultTimeout`.
385
392
@@ -400,14 +407,15 @@ async def create(
400
407
"extension_id" : extension_id ,
401
408
"keep_alive" : keep_alive ,
402
409
"proxies" : proxies ,
410
+ "region" : region ,
403
411
"timeout" : api_timeout ,
404
412
},
405
413
session_create_params .SessionCreateParams ,
406
414
),
407
415
options = make_request_options (
408
416
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
409
417
),
410
- cast_to = Session ,
418
+ cast_to = SessionCreateResponse ,
411
419
)
412
420
413
421
async def retrieve (
0 commit comments