2525from ..types .session import Session as TypesSession
2626from ..types .sessionslist import Session as SessionslistSession
2727from ..types .session_context import SessionContext
28+ from ..types .session_events_response import SessionEventsResponse
2829from ..types .session_release_response import SessionReleaseResponse
2930from ..types .session_release_all_response import SessionReleaseAllResponse
31+ from ..types .session_live_details_response import SessionLiveDetailsResponse
3032
3133__all__ = ["SessionsResource" , "AsyncSessionsResource" ]
3234
@@ -252,6 +254,72 @@ def context(
252254 cast_to = SessionContext ,
253255 )
254256
257+ def events (
258+ self ,
259+ id : str ,
260+ * ,
261+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
262+ # The extra values given here take precedence over values defined on the client or passed to this method.
263+ extra_headers : Headers | None = None ,
264+ extra_query : Query | None = None ,
265+ extra_body : Body | None = None ,
266+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
267+ ) -> SessionEventsResponse :
268+ """
269+ This endpoint allows you to get the recorded session events in the RRWeb format
270+
271+ Args:
272+ extra_headers: Send extra headers
273+
274+ extra_query: Add additional query parameters to the request
275+
276+ extra_body: Add additional JSON properties to the request
277+
278+ timeout: Override the client-level default timeout for this request, in seconds
279+ """
280+ if not id :
281+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
282+ return self ._get (
283+ f"/v1/sessions/{ id } /events" ,
284+ options = make_request_options (
285+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
286+ ),
287+ cast_to = SessionEventsResponse ,
288+ )
289+
290+ def live_details (
291+ self ,
292+ id : str ,
293+ * ,
294+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
295+ # The extra values given here take precedence over values defined on the client or passed to this method.
296+ extra_headers : Headers | None = None ,
297+ extra_query : Query | None = None ,
298+ extra_body : Body | None = None ,
299+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
300+ ) -> SessionLiveDetailsResponse :
301+ """
302+ Returns the live state of the session, including pages, tabs, and browser state
303+
304+ Args:
305+ extra_headers: Send extra headers
306+
307+ extra_query: Add additional query parameters to the request
308+
309+ extra_body: Add additional JSON properties to the request
310+
311+ timeout: Override the client-level default timeout for this request, in seconds
312+ """
313+ if not id :
314+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
315+ return self ._get (
316+ f"/v1/sessions/{ id } /live-details" ,
317+ options = make_request_options (
318+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
319+ ),
320+ cast_to = SessionLiveDetailsResponse ,
321+ )
322+
255323 def release (
256324 self ,
257325 id : str ,
@@ -526,6 +594,72 @@ async def context(
526594 cast_to = SessionContext ,
527595 )
528596
597+ async def events (
598+ self ,
599+ id : str ,
600+ * ,
601+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
602+ # The extra values given here take precedence over values defined on the client or passed to this method.
603+ extra_headers : Headers | None = None ,
604+ extra_query : Query | None = None ,
605+ extra_body : Body | None = None ,
606+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
607+ ) -> SessionEventsResponse :
608+ """
609+ This endpoint allows you to get the recorded session events in the RRWeb format
610+
611+ Args:
612+ extra_headers: Send extra headers
613+
614+ extra_query: Add additional query parameters to the request
615+
616+ extra_body: Add additional JSON properties to the request
617+
618+ timeout: Override the client-level default timeout for this request, in seconds
619+ """
620+ if not id :
621+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
622+ return await self ._get (
623+ f"/v1/sessions/{ id } /events" ,
624+ options = make_request_options (
625+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
626+ ),
627+ cast_to = SessionEventsResponse ,
628+ )
629+
630+ async def live_details (
631+ self ,
632+ id : str ,
633+ * ,
634+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
635+ # The extra values given here take precedence over values defined on the client or passed to this method.
636+ extra_headers : Headers | None = None ,
637+ extra_query : Query | None = None ,
638+ extra_body : Body | None = None ,
639+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
640+ ) -> SessionLiveDetailsResponse :
641+ """
642+ Returns the live state of the session, including pages, tabs, and browser state
643+
644+ Args:
645+ extra_headers: Send extra headers
646+
647+ extra_query: Add additional query parameters to the request
648+
649+ extra_body: Add additional JSON properties to the request
650+
651+ timeout: Override the client-level default timeout for this request, in seconds
652+ """
653+ if not id :
654+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
655+ return await self ._get (
656+ f"/v1/sessions/{ id } /live-details" ,
657+ options = make_request_options (
658+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
659+ ),
660+ cast_to = SessionLiveDetailsResponse ,
661+ )
662+
529663 async def release (
530664 self ,
531665 id : str ,
@@ -595,6 +729,12 @@ def __init__(self, sessions: SessionsResource) -> None:
595729 self .context = to_raw_response_wrapper (
596730 sessions .context ,
597731 )
732+ self .events = to_raw_response_wrapper (
733+ sessions .events ,
734+ )
735+ self .live_details = to_raw_response_wrapper (
736+ sessions .live_details ,
737+ )
598738 self .release = to_raw_response_wrapper (
599739 sessions .release ,
600740 )
@@ -619,6 +759,12 @@ def __init__(self, sessions: AsyncSessionsResource) -> None:
619759 self .context = async_to_raw_response_wrapper (
620760 sessions .context ,
621761 )
762+ self .events = async_to_raw_response_wrapper (
763+ sessions .events ,
764+ )
765+ self .live_details = async_to_raw_response_wrapper (
766+ sessions .live_details ,
767+ )
622768 self .release = async_to_raw_response_wrapper (
623769 sessions .release ,
624770 )
@@ -643,6 +789,12 @@ def __init__(self, sessions: SessionsResource) -> None:
643789 self .context = to_streamed_response_wrapper (
644790 sessions .context ,
645791 )
792+ self .events = to_streamed_response_wrapper (
793+ sessions .events ,
794+ )
795+ self .live_details = to_streamed_response_wrapper (
796+ sessions .live_details ,
797+ )
646798 self .release = to_streamed_response_wrapper (
647799 sessions .release ,
648800 )
@@ -667,6 +819,12 @@ def __init__(self, sessions: AsyncSessionsResource) -> None:
667819 self .context = async_to_streamed_response_wrapper (
668820 sessions .context ,
669821 )
822+ self .events = async_to_streamed_response_wrapper (
823+ sessions .events ,
824+ )
825+ self .live_details = async_to_streamed_response_wrapper (
826+ sessions .live_details ,
827+ )
670828 self .release = async_to_streamed_response_wrapper (
671829 sessions .release ,
672830 )
0 commit comments