2626from ..types .invocation_follow_response import InvocationFollowResponse
2727from ..types .invocation_update_response import InvocationUpdateResponse
2828from ..types .invocation_retrieve_response import InvocationRetrieveResponse
29+ from ..types .invocation_list_browsers_response import InvocationListBrowsersResponse
2930
3031__all__ = ["InvocationsResource" , "AsyncInvocationsResource" ]
3132
@@ -347,6 +348,39 @@ def follow(
347348 stream_cls = Stream [InvocationFollowResponse ],
348349 )
349350
351+ def list_browsers (
352+ self ,
353+ id : str ,
354+ * ,
355+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
356+ # The extra values given here take precedence over values defined on the client or passed to this method.
357+ extra_headers : Headers | None = None ,
358+ extra_query : Query | None = None ,
359+ extra_body : Body | None = None ,
360+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
361+ ) -> InvocationListBrowsersResponse :
362+ """
363+ Returns all active browser sessions created within the specified invocation.
364+
365+ Args:
366+ extra_headers: Send extra headers
367+
368+ extra_query: Add additional query parameters to the request
369+
370+ extra_body: Add additional JSON properties to the request
371+
372+ timeout: Override the client-level default timeout for this request, in seconds
373+ """
374+ if not id :
375+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
376+ return self ._get (
377+ f"/invocations/{ id } /browsers" ,
378+ options = make_request_options (
379+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
380+ ),
381+ cast_to = InvocationListBrowsersResponse ,
382+ )
383+
350384
351385class AsyncInvocationsResource (AsyncAPIResource ):
352386 @cached_property
@@ -665,6 +699,39 @@ async def follow(
665699 stream_cls = AsyncStream [InvocationFollowResponse ],
666700 )
667701
702+ async def list_browsers (
703+ self ,
704+ id : str ,
705+ * ,
706+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
707+ # The extra values given here take precedence over values defined on the client or passed to this method.
708+ extra_headers : Headers | None = None ,
709+ extra_query : Query | None = None ,
710+ extra_body : Body | None = None ,
711+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
712+ ) -> InvocationListBrowsersResponse :
713+ """
714+ Returns all active browser sessions created within the specified invocation.
715+
716+ Args:
717+ extra_headers: Send extra headers
718+
719+ extra_query: Add additional query parameters to the request
720+
721+ extra_body: Add additional JSON properties to the request
722+
723+ timeout: Override the client-level default timeout for this request, in seconds
724+ """
725+ if not id :
726+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
727+ return await self ._get (
728+ f"/invocations/{ id } /browsers" ,
729+ options = make_request_options (
730+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
731+ ),
732+ cast_to = InvocationListBrowsersResponse ,
733+ )
734+
668735
669736class InvocationsResourceWithRawResponse :
670737 def __init__ (self , invocations : InvocationsResource ) -> None :
@@ -688,6 +755,9 @@ def __init__(self, invocations: InvocationsResource) -> None:
688755 self .follow = to_raw_response_wrapper (
689756 invocations .follow ,
690757 )
758+ self .list_browsers = to_raw_response_wrapper (
759+ invocations .list_browsers ,
760+ )
691761
692762
693763class AsyncInvocationsResourceWithRawResponse :
@@ -712,6 +782,9 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None:
712782 self .follow = async_to_raw_response_wrapper (
713783 invocations .follow ,
714784 )
785+ self .list_browsers = async_to_raw_response_wrapper (
786+ invocations .list_browsers ,
787+ )
715788
716789
717790class InvocationsResourceWithStreamingResponse :
@@ -736,6 +809,9 @@ def __init__(self, invocations: InvocationsResource) -> None:
736809 self .follow = to_streamed_response_wrapper (
737810 invocations .follow ,
738811 )
812+ self .list_browsers = to_streamed_response_wrapper (
813+ invocations .list_browsers ,
814+ )
739815
740816
741817class AsyncInvocationsResourceWithStreamingResponse :
@@ -760,3 +836,6 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None:
760836 self .follow = async_to_streamed_response_wrapper (
761837 invocations .follow ,
762838 )
839+ self .list_browsers = async_to_streamed_response_wrapper (
840+ invocations .list_browsers ,
841+ )
0 commit comments