22
33from __future__ import annotations
44
5- from typing import Union , Iterable
65from typing_extensions import Literal
76
87import httpx
5756from ...types .session import Session
5857from ...types .session_live_urls import SessionLiveURLs
5958from ...types .session_list_response import SessionListResponse
59+ from ...types .session_create_response import SessionCreateResponse
6060
6161__all__ = ["SessionsResource" , "AsyncSessionsResource" ]
6262
@@ -104,15 +104,16 @@ 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 , 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 ,
108109 api_timeout : int | NotGiven = NOT_GIVEN ,
109110 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
110111 # The extra values given here take precedence over values defined on the client or passed to this method.
111112 extra_headers : Headers | None = None ,
112113 extra_query : Query | None = None ,
113114 extra_body : Body | None = None ,
114115 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
115- ) -> Session :
116+ ) -> SessionCreateResponse :
116117 """Create a Session
117118
118119 Args:
@@ -130,6 +131,8 @@ def create(
130131 proxies: Proxy configuration. Can be true for default proxy, or an array of proxy
131132 configurations.
132133
134+ region: The region where the Session should run.
135+
133136 api_timeout: Duration in seconds after which the session will automatically end. Defaults to
134137 the Project's `defaultTimeout`.
135138
@@ -150,14 +153,15 @@ def create(
150153 "extension_id" : extension_id ,
151154 "keep_alive" : keep_alive ,
152155 "proxies" : proxies ,
156+ "region" : region ,
153157 "timeout" : api_timeout ,
154158 },
155159 session_create_params .SessionCreateParams ,
156160 ),
157161 options = make_request_options (
158162 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
159163 ),
160- cast_to = Session ,
164+ cast_to = SessionCreateResponse ,
161165 )
162166
163167 def retrieve (
@@ -354,15 +358,16 @@ async def create(
354358 browser_settings : session_create_params .BrowserSettings | NotGiven = NOT_GIVEN ,
355359 extension_id : str | NotGiven = NOT_GIVEN ,
356360 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 ,
358363 api_timeout : int | NotGiven = NOT_GIVEN ,
359364 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
360365 # The extra values given here take precedence over values defined on the client or passed to this method.
361366 extra_headers : Headers | None = None ,
362367 extra_query : Query | None = None ,
363368 extra_body : Body | None = None ,
364369 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
365- ) -> Session :
370+ ) -> SessionCreateResponse :
366371 """Create a Session
367372
368373 Args:
@@ -380,6 +385,8 @@ async def create(
380385 proxies: Proxy configuration. Can be true for default proxy, or an array of proxy
381386 configurations.
382387
388+ region: The region where the Session should run.
389+
383390 api_timeout: Duration in seconds after which the session will automatically end. Defaults to
384391 the Project's `defaultTimeout`.
385392
@@ -400,14 +407,15 @@ async def create(
400407 "extension_id" : extension_id ,
401408 "keep_alive" : keep_alive ,
402409 "proxies" : proxies ,
410+ "region" : region ,
403411 "timeout" : api_timeout ,
404412 },
405413 session_create_params .SessionCreateParams ,
406414 ),
407415 options = make_request_options (
408416 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
409417 ),
410- cast_to = Session ,
418+ cast_to = SessionCreateResponse ,
411419 )
412420
413421 async def retrieve (
0 commit comments