8
8
import httpx
9
9
10
10
from ..types import invocation_create_params , invocation_update_params
11
- from .._types import NOT_GIVEN , Body , Query , Headers , NotGiven
11
+ from .._types import NOT_GIVEN , Body , Query , Headers , NoneType , NotGiven
12
12
from .._utils import maybe_transform , async_maybe_transform
13
13
from .._compat import cached_property
14
14
from .._resource import SyncAPIResource , AsyncAPIResource
@@ -183,6 +183,40 @@ def update(
183
183
cast_to = InvocationUpdateResponse ,
184
184
)
185
185
186
+ def delete_browsers (
187
+ self ,
188
+ id : str ,
189
+ * ,
190
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
191
+ # The extra values given here take precedence over values defined on the client or passed to this method.
192
+ extra_headers : Headers | None = None ,
193
+ extra_query : Query | None = None ,
194
+ extra_body : Body | None = None ,
195
+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
196
+ ) -> None :
197
+ """
198
+ Delete all browser sessions created within the specified invocation.
199
+
200
+ Args:
201
+ extra_headers: Send extra headers
202
+
203
+ extra_query: Add additional query parameters to the request
204
+
205
+ extra_body: Add additional JSON properties to the request
206
+
207
+ timeout: Override the client-level default timeout for this request, in seconds
208
+ """
209
+ if not id :
210
+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
211
+ extra_headers = {"Accept" : "*/*" , ** (extra_headers or {})}
212
+ return self ._delete (
213
+ f"/invocations/{ id } /browsers" ,
214
+ options = make_request_options (
215
+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
216
+ ),
217
+ cast_to = NoneType ,
218
+ )
219
+
186
220
def follow (
187
221
self ,
188
222
id : str ,
@@ -379,6 +413,40 @@ async def update(
379
413
cast_to = InvocationUpdateResponse ,
380
414
)
381
415
416
+ async def delete_browsers (
417
+ self ,
418
+ id : str ,
419
+ * ,
420
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
421
+ # The extra values given here take precedence over values defined on the client or passed to this method.
422
+ extra_headers : Headers | None = None ,
423
+ extra_query : Query | None = None ,
424
+ extra_body : Body | None = None ,
425
+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
426
+ ) -> None :
427
+ """
428
+ Delete all browser sessions created within the specified invocation.
429
+
430
+ Args:
431
+ extra_headers: Send extra headers
432
+
433
+ extra_query: Add additional query parameters to the request
434
+
435
+ extra_body: Add additional JSON properties to the request
436
+
437
+ timeout: Override the client-level default timeout for this request, in seconds
438
+ """
439
+ if not id :
440
+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
441
+ extra_headers = {"Accept" : "*/*" , ** (extra_headers or {})}
442
+ return await self ._delete (
443
+ f"/invocations/{ id } /browsers" ,
444
+ options = make_request_options (
445
+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
446
+ ),
447
+ cast_to = NoneType ,
448
+ )
449
+
382
450
async def follow (
383
451
self ,
384
452
id : str ,
@@ -433,6 +501,9 @@ def __init__(self, invocations: InvocationsResource) -> None:
433
501
self .update = to_raw_response_wrapper (
434
502
invocations .update ,
435
503
)
504
+ self .delete_browsers = to_raw_response_wrapper (
505
+ invocations .delete_browsers ,
506
+ )
436
507
self .follow = to_raw_response_wrapper (
437
508
invocations .follow ,
438
509
)
@@ -451,6 +522,9 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None:
451
522
self .update = async_to_raw_response_wrapper (
452
523
invocations .update ,
453
524
)
525
+ self .delete_browsers = async_to_raw_response_wrapper (
526
+ invocations .delete_browsers ,
527
+ )
454
528
self .follow = async_to_raw_response_wrapper (
455
529
invocations .follow ,
456
530
)
@@ -469,6 +543,9 @@ def __init__(self, invocations: InvocationsResource) -> None:
469
543
self .update = to_streamed_response_wrapper (
470
544
invocations .update ,
471
545
)
546
+ self .delete_browsers = to_streamed_response_wrapper (
547
+ invocations .delete_browsers ,
548
+ )
472
549
self .follow = to_streamed_response_wrapper (
473
550
invocations .follow ,
474
551
)
@@ -487,6 +564,9 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None:
487
564
self .update = async_to_streamed_response_wrapper (
488
565
invocations .update ,
489
566
)
567
+ self .delete_browsers = async_to_streamed_response_wrapper (
568
+ invocations .delete_browsers ,
569
+ )
490
570
self .follow = async_to_streamed_response_wrapper (
491
571
invocations .follow ,
492
572
)
0 commit comments