anchorbrowser 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- anchorbrowser/__init__.py +100 -0
- anchorbrowser/_base_client.py +1995 -0
- anchorbrowser/_client.py +440 -0
- anchorbrowser/_compat.py +219 -0
- anchorbrowser/_constants.py +14 -0
- anchorbrowser/_exceptions.py +108 -0
- anchorbrowser/_files.py +123 -0
- anchorbrowser/_models.py +829 -0
- anchorbrowser/_qs.py +150 -0
- anchorbrowser/_resource.py +43 -0
- anchorbrowser/_response.py +832 -0
- anchorbrowser/_streaming.py +333 -0
- anchorbrowser/_types.py +219 -0
- anchorbrowser/_utils/__init__.py +57 -0
- anchorbrowser/_utils/_logs.py +25 -0
- anchorbrowser/_utils/_proxy.py +65 -0
- anchorbrowser/_utils/_reflection.py +42 -0
- anchorbrowser/_utils/_resources_proxy.py +24 -0
- anchorbrowser/_utils/_streams.py +12 -0
- anchorbrowser/_utils/_sync.py +86 -0
- anchorbrowser/_utils/_transform.py +447 -0
- anchorbrowser/_utils/_typing.py +151 -0
- anchorbrowser/_utils/_utils.py +422 -0
- anchorbrowser/_version.py +4 -0
- anchorbrowser/lib/.keep +4 -0
- anchorbrowser/lib/agent.py +69 -0
- anchorbrowser/lib/browser.py +186 -0
- anchorbrowser/py.typed +0 -0
- anchorbrowser/resources/__init__.py +61 -0
- anchorbrowser/resources/agent.py +305 -0
- anchorbrowser/resources/browser.py +152 -0
- anchorbrowser/resources/extensions.py +412 -0
- anchorbrowser/resources/profiles.py +553 -0
- anchorbrowser/resources/sessions/__init__.py +89 -0
- anchorbrowser/resources/sessions/all.py +192 -0
- anchorbrowser/resources/sessions/clipboard.py +252 -0
- anchorbrowser/resources/sessions/keyboard.py +298 -0
- anchorbrowser/resources/sessions/mouse.py +651 -0
- anchorbrowser/resources/sessions/recordings/__init__.py +33 -0
- anchorbrowser/resources/sessions/recordings/primary.py +176 -0
- anchorbrowser/resources/sessions/recordings/recordings.py +357 -0
- anchorbrowser/resources/sessions/sessions.py +1122 -0
- anchorbrowser/resources/tools.py +529 -0
- anchorbrowser/types/__init__.py +32 -0
- anchorbrowser/types/extension_delete_response.py +12 -0
- anchorbrowser/types/extension_list_response.py +31 -0
- anchorbrowser/types/extension_manifest.py +28 -0
- anchorbrowser/types/extension_retrieve_response.py +27 -0
- anchorbrowser/types/extension_upload_params.py +17 -0
- anchorbrowser/types/extension_upload_response.py +31 -0
- anchorbrowser/types/profile_create_params.py +31 -0
- anchorbrowser/types/profile_list_response.py +43 -0
- anchorbrowser/types/profile_retrieve_response.py +36 -0
- anchorbrowser/types/profile_update_params.py +27 -0
- anchorbrowser/types/session_copy_response.py +12 -0
- anchorbrowser/types/session_create_params.py +196 -0
- anchorbrowser/types/session_create_response.py +22 -0
- anchorbrowser/types/session_drag_and_drop_params.py +26 -0
- anchorbrowser/types/session_drag_and_drop_response.py +11 -0
- anchorbrowser/types/session_goto_params.py +12 -0
- anchorbrowser/types/session_goto_response.py +11 -0
- anchorbrowser/types/session_paste_params.py +12 -0
- anchorbrowser/types/session_paste_response.py +11 -0
- anchorbrowser/types/session_retrieve_downloads_response.py +51 -0
- anchorbrowser/types/session_scroll_params.py +26 -0
- anchorbrowser/types/session_scroll_response.py +11 -0
- anchorbrowser/types/sessions/__init__.py +25 -0
- anchorbrowser/types/sessions/all_status_response.py +30 -0
- anchorbrowser/types/sessions/clipboard_get_response.py +16 -0
- anchorbrowser/types/sessions/clipboard_set_params.py +12 -0
- anchorbrowser/types/sessions/clipboard_set_response.py +11 -0
- anchorbrowser/types/sessions/keyboard_shortcut_params.py +18 -0
- anchorbrowser/types/sessions/keyboard_shortcut_response.py +11 -0
- anchorbrowser/types/sessions/keyboard_type_params.py +15 -0
- anchorbrowser/types/sessions/keyboard_type_response.py +11 -0
- anchorbrowser/types/sessions/mouse_click_params.py +18 -0
- anchorbrowser/types/sessions/mouse_click_response.py +11 -0
- anchorbrowser/types/sessions/mouse_double_click_params.py +18 -0
- anchorbrowser/types/sessions/mouse_double_click_response.py +11 -0
- anchorbrowser/types/sessions/mouse_down_params.py +18 -0
- anchorbrowser/types/sessions/mouse_down_response.py +11 -0
- anchorbrowser/types/sessions/mouse_move_params.py +15 -0
- anchorbrowser/types/sessions/mouse_move_response.py +11 -0
- anchorbrowser/types/sessions/mouse_up_params.py +18 -0
- anchorbrowser/types/sessions/mouse_up_response.py +11 -0
- anchorbrowser/types/sessions/recording_list_response.py +46 -0
- anchorbrowser/types/sessions/recording_pause_response.py +12 -0
- anchorbrowser/types/sessions/recording_resume_response.py +12 -0
- anchorbrowser/types/sessions/recordings/__init__.py +3 -0
- anchorbrowser/types/shared/__init__.py +3 -0
- anchorbrowser/types/shared/success_response.py +15 -0
- anchorbrowser/types/tool_fetch_webpage_params.py +26 -0
- anchorbrowser/types/tool_fetch_webpage_response.py +7 -0
- anchorbrowser/types/tool_perform_web_task_params.py +30 -0
- anchorbrowser/types/tool_perform_web_task_response.py +16 -0
- anchorbrowser/types/tool_screenshot_webpage_params.py +48 -0
- anchorbrowser-0.1.0.dist-info/METADATA +449 -0
- anchorbrowser-0.1.0.dist-info/RECORD +100 -0
- anchorbrowser-0.1.0.dist-info/WHEEL +4 -0
- anchorbrowser-0.1.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
8
|
+
from ...._compat import cached_property
|
|
9
|
+
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
10
|
+
from ...._response import (
|
|
11
|
+
BinaryAPIResponse,
|
|
12
|
+
AsyncBinaryAPIResponse,
|
|
13
|
+
StreamedBinaryAPIResponse,
|
|
14
|
+
AsyncStreamedBinaryAPIResponse,
|
|
15
|
+
to_custom_raw_response_wrapper,
|
|
16
|
+
to_custom_streamed_response_wrapper,
|
|
17
|
+
async_to_custom_raw_response_wrapper,
|
|
18
|
+
async_to_custom_streamed_response_wrapper,
|
|
19
|
+
)
|
|
20
|
+
from ...._base_client import make_request_options
|
|
21
|
+
|
|
22
|
+
__all__ = ["PrimaryResource", "AsyncPrimaryResource"]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class PrimaryResource(SyncAPIResource):
|
|
26
|
+
@cached_property
|
|
27
|
+
def with_raw_response(self) -> PrimaryResourceWithRawResponse:
|
|
28
|
+
"""
|
|
29
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
30
|
+
the raw response object instead of the parsed content.
|
|
31
|
+
|
|
32
|
+
For more information, see https://www.github.com/anchorbrowser/AnchorBrowser-SDK-Python#accessing-raw-response-data-eg-headers
|
|
33
|
+
"""
|
|
34
|
+
return PrimaryResourceWithRawResponse(self)
|
|
35
|
+
|
|
36
|
+
@cached_property
|
|
37
|
+
def with_streaming_response(self) -> PrimaryResourceWithStreamingResponse:
|
|
38
|
+
"""
|
|
39
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
40
|
+
|
|
41
|
+
For more information, see https://www.github.com/anchorbrowser/AnchorBrowser-SDK-Python#with_streaming_response
|
|
42
|
+
"""
|
|
43
|
+
return PrimaryResourceWithStreamingResponse(self)
|
|
44
|
+
|
|
45
|
+
def get(
|
|
46
|
+
self,
|
|
47
|
+
session_id: str,
|
|
48
|
+
*,
|
|
49
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
50
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
51
|
+
extra_headers: Headers | None = None,
|
|
52
|
+
extra_query: Query | None = None,
|
|
53
|
+
extra_body: Body | None = None,
|
|
54
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
55
|
+
) -> BinaryAPIResponse:
|
|
56
|
+
"""Downloads the primary recording file for the specified browser session.
|
|
57
|
+
|
|
58
|
+
Returns
|
|
59
|
+
the recording as an MP4 file.
|
|
60
|
+
|
|
61
|
+
Args:
|
|
62
|
+
extra_headers: Send extra headers
|
|
63
|
+
|
|
64
|
+
extra_query: Add additional query parameters to the request
|
|
65
|
+
|
|
66
|
+
extra_body: Add additional JSON properties to the request
|
|
67
|
+
|
|
68
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
69
|
+
"""
|
|
70
|
+
if not session_id:
|
|
71
|
+
raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
|
|
72
|
+
extra_headers = {"Accept": "video/mp4", **(extra_headers or {})}
|
|
73
|
+
return self._get(
|
|
74
|
+
f"/v1/sessions/{session_id}/recordings/primary/fetch",
|
|
75
|
+
options=make_request_options(
|
|
76
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
77
|
+
),
|
|
78
|
+
cast_to=BinaryAPIResponse,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
class AsyncPrimaryResource(AsyncAPIResource):
|
|
83
|
+
@cached_property
|
|
84
|
+
def with_raw_response(self) -> AsyncPrimaryResourceWithRawResponse:
|
|
85
|
+
"""
|
|
86
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
87
|
+
the raw response object instead of the parsed content.
|
|
88
|
+
|
|
89
|
+
For more information, see https://www.github.com/anchorbrowser/AnchorBrowser-SDK-Python#accessing-raw-response-data-eg-headers
|
|
90
|
+
"""
|
|
91
|
+
return AsyncPrimaryResourceWithRawResponse(self)
|
|
92
|
+
|
|
93
|
+
@cached_property
|
|
94
|
+
def with_streaming_response(self) -> AsyncPrimaryResourceWithStreamingResponse:
|
|
95
|
+
"""
|
|
96
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
97
|
+
|
|
98
|
+
For more information, see https://www.github.com/anchorbrowser/AnchorBrowser-SDK-Python#with_streaming_response
|
|
99
|
+
"""
|
|
100
|
+
return AsyncPrimaryResourceWithStreamingResponse(self)
|
|
101
|
+
|
|
102
|
+
async def get(
|
|
103
|
+
self,
|
|
104
|
+
session_id: str,
|
|
105
|
+
*,
|
|
106
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
107
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
108
|
+
extra_headers: Headers | None = None,
|
|
109
|
+
extra_query: Query | None = None,
|
|
110
|
+
extra_body: Body | None = None,
|
|
111
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
112
|
+
) -> AsyncBinaryAPIResponse:
|
|
113
|
+
"""Downloads the primary recording file for the specified browser session.
|
|
114
|
+
|
|
115
|
+
Returns
|
|
116
|
+
the recording as an MP4 file.
|
|
117
|
+
|
|
118
|
+
Args:
|
|
119
|
+
extra_headers: Send extra headers
|
|
120
|
+
|
|
121
|
+
extra_query: Add additional query parameters to the request
|
|
122
|
+
|
|
123
|
+
extra_body: Add additional JSON properties to the request
|
|
124
|
+
|
|
125
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
126
|
+
"""
|
|
127
|
+
if not session_id:
|
|
128
|
+
raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
|
|
129
|
+
extra_headers = {"Accept": "video/mp4", **(extra_headers or {})}
|
|
130
|
+
return await self._get(
|
|
131
|
+
f"/v1/sessions/{session_id}/recordings/primary/fetch",
|
|
132
|
+
options=make_request_options(
|
|
133
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
134
|
+
),
|
|
135
|
+
cast_to=AsyncBinaryAPIResponse,
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
class PrimaryResourceWithRawResponse:
|
|
140
|
+
def __init__(self, primary: PrimaryResource) -> None:
|
|
141
|
+
self._primary = primary
|
|
142
|
+
|
|
143
|
+
self.get = to_custom_raw_response_wrapper(
|
|
144
|
+
primary.get,
|
|
145
|
+
BinaryAPIResponse,
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
class AsyncPrimaryResourceWithRawResponse:
|
|
150
|
+
def __init__(self, primary: AsyncPrimaryResource) -> None:
|
|
151
|
+
self._primary = primary
|
|
152
|
+
|
|
153
|
+
self.get = async_to_custom_raw_response_wrapper(
|
|
154
|
+
primary.get,
|
|
155
|
+
AsyncBinaryAPIResponse,
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
class PrimaryResourceWithStreamingResponse:
|
|
160
|
+
def __init__(self, primary: PrimaryResource) -> None:
|
|
161
|
+
self._primary = primary
|
|
162
|
+
|
|
163
|
+
self.get = to_custom_streamed_response_wrapper(
|
|
164
|
+
primary.get,
|
|
165
|
+
StreamedBinaryAPIResponse,
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
class AsyncPrimaryResourceWithStreamingResponse:
|
|
170
|
+
def __init__(self, primary: AsyncPrimaryResource) -> None:
|
|
171
|
+
self._primary = primary
|
|
172
|
+
|
|
173
|
+
self.get = async_to_custom_streamed_response_wrapper(
|
|
174
|
+
primary.get,
|
|
175
|
+
AsyncStreamedBinaryAPIResponse,
|
|
176
|
+
)
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from .primary import (
|
|
8
|
+
PrimaryResource,
|
|
9
|
+
AsyncPrimaryResource,
|
|
10
|
+
PrimaryResourceWithRawResponse,
|
|
11
|
+
AsyncPrimaryResourceWithRawResponse,
|
|
12
|
+
PrimaryResourceWithStreamingResponse,
|
|
13
|
+
AsyncPrimaryResourceWithStreamingResponse,
|
|
14
|
+
)
|
|
15
|
+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
16
|
+
from ...._compat import cached_property
|
|
17
|
+
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
18
|
+
from ...._response import (
|
|
19
|
+
to_raw_response_wrapper,
|
|
20
|
+
to_streamed_response_wrapper,
|
|
21
|
+
async_to_raw_response_wrapper,
|
|
22
|
+
async_to_streamed_response_wrapper,
|
|
23
|
+
)
|
|
24
|
+
from ...._base_client import make_request_options
|
|
25
|
+
from ....types.sessions.recording_list_response import RecordingListResponse
|
|
26
|
+
from ....types.sessions.recording_pause_response import RecordingPauseResponse
|
|
27
|
+
from ....types.sessions.recording_resume_response import RecordingResumeResponse
|
|
28
|
+
|
|
29
|
+
__all__ = ["RecordingsResource", "AsyncRecordingsResource"]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class RecordingsResource(SyncAPIResource):
|
|
33
|
+
@cached_property
|
|
34
|
+
def primary(self) -> PrimaryResource:
|
|
35
|
+
return PrimaryResource(self._client)
|
|
36
|
+
|
|
37
|
+
@cached_property
|
|
38
|
+
def with_raw_response(self) -> RecordingsResourceWithRawResponse:
|
|
39
|
+
"""
|
|
40
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
41
|
+
the raw response object instead of the parsed content.
|
|
42
|
+
|
|
43
|
+
For more information, see https://www.github.com/anchorbrowser/AnchorBrowser-SDK-Python#accessing-raw-response-data-eg-headers
|
|
44
|
+
"""
|
|
45
|
+
return RecordingsResourceWithRawResponse(self)
|
|
46
|
+
|
|
47
|
+
@cached_property
|
|
48
|
+
def with_streaming_response(self) -> RecordingsResourceWithStreamingResponse:
|
|
49
|
+
"""
|
|
50
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
51
|
+
|
|
52
|
+
For more information, see https://www.github.com/anchorbrowser/AnchorBrowser-SDK-Python#with_streaming_response
|
|
53
|
+
"""
|
|
54
|
+
return RecordingsResourceWithStreamingResponse(self)
|
|
55
|
+
|
|
56
|
+
def list(
|
|
57
|
+
self,
|
|
58
|
+
session_id: str,
|
|
59
|
+
*,
|
|
60
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
61
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
62
|
+
extra_headers: Headers | None = None,
|
|
63
|
+
extra_query: Query | None = None,
|
|
64
|
+
extra_body: Body | None = None,
|
|
65
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
66
|
+
) -> RecordingListResponse:
|
|
67
|
+
"""Retrieves the URLs of the browser session's video recordings.
|
|
68
|
+
|
|
69
|
+
Requires a valid
|
|
70
|
+
API key for authentication.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
extra_headers: Send extra headers
|
|
74
|
+
|
|
75
|
+
extra_query: Add additional query parameters to the request
|
|
76
|
+
|
|
77
|
+
extra_body: Add additional JSON properties to the request
|
|
78
|
+
|
|
79
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
80
|
+
"""
|
|
81
|
+
if not session_id:
|
|
82
|
+
raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
|
|
83
|
+
return self._get(
|
|
84
|
+
f"/v1/sessions/{session_id}/recordings",
|
|
85
|
+
options=make_request_options(
|
|
86
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
87
|
+
),
|
|
88
|
+
cast_to=RecordingListResponse,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
def pause(
|
|
92
|
+
self,
|
|
93
|
+
session_id: str,
|
|
94
|
+
*,
|
|
95
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
96
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
97
|
+
extra_headers: Headers | None = None,
|
|
98
|
+
extra_query: Query | None = None,
|
|
99
|
+
extra_body: Body | None = None,
|
|
100
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
101
|
+
) -> RecordingPauseResponse:
|
|
102
|
+
"""
|
|
103
|
+
Pauses the video recording for the specified browser session.
|
|
104
|
+
|
|
105
|
+
Args:
|
|
106
|
+
extra_headers: Send extra headers
|
|
107
|
+
|
|
108
|
+
extra_query: Add additional query parameters to the request
|
|
109
|
+
|
|
110
|
+
extra_body: Add additional JSON properties to the request
|
|
111
|
+
|
|
112
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
113
|
+
"""
|
|
114
|
+
if not session_id:
|
|
115
|
+
raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
|
|
116
|
+
return self._post(
|
|
117
|
+
f"/v1/sessions/{session_id}/recordings/pause",
|
|
118
|
+
options=make_request_options(
|
|
119
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
120
|
+
),
|
|
121
|
+
cast_to=RecordingPauseResponse,
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
def resume(
|
|
125
|
+
self,
|
|
126
|
+
session_id: str,
|
|
127
|
+
*,
|
|
128
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
129
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
130
|
+
extra_headers: Headers | None = None,
|
|
131
|
+
extra_query: Query | None = None,
|
|
132
|
+
extra_body: Body | None = None,
|
|
133
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
134
|
+
) -> RecordingResumeResponse:
|
|
135
|
+
"""
|
|
136
|
+
Resumes the video recording for the specified browser session.
|
|
137
|
+
|
|
138
|
+
Args:
|
|
139
|
+
extra_headers: Send extra headers
|
|
140
|
+
|
|
141
|
+
extra_query: Add additional query parameters to the request
|
|
142
|
+
|
|
143
|
+
extra_body: Add additional JSON properties to the request
|
|
144
|
+
|
|
145
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
146
|
+
"""
|
|
147
|
+
if not session_id:
|
|
148
|
+
raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
|
|
149
|
+
return self._post(
|
|
150
|
+
f"/v1/sessions/{session_id}/recordings/resume",
|
|
151
|
+
options=make_request_options(
|
|
152
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
153
|
+
),
|
|
154
|
+
cast_to=RecordingResumeResponse,
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
class AsyncRecordingsResource(AsyncAPIResource):
|
|
159
|
+
@cached_property
|
|
160
|
+
def primary(self) -> AsyncPrimaryResource:
|
|
161
|
+
return AsyncPrimaryResource(self._client)
|
|
162
|
+
|
|
163
|
+
@cached_property
|
|
164
|
+
def with_raw_response(self) -> AsyncRecordingsResourceWithRawResponse:
|
|
165
|
+
"""
|
|
166
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
167
|
+
the raw response object instead of the parsed content.
|
|
168
|
+
|
|
169
|
+
For more information, see https://www.github.com/anchorbrowser/AnchorBrowser-SDK-Python#accessing-raw-response-data-eg-headers
|
|
170
|
+
"""
|
|
171
|
+
return AsyncRecordingsResourceWithRawResponse(self)
|
|
172
|
+
|
|
173
|
+
@cached_property
|
|
174
|
+
def with_streaming_response(self) -> AsyncRecordingsResourceWithStreamingResponse:
|
|
175
|
+
"""
|
|
176
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
177
|
+
|
|
178
|
+
For more information, see https://www.github.com/anchorbrowser/AnchorBrowser-SDK-Python#with_streaming_response
|
|
179
|
+
"""
|
|
180
|
+
return AsyncRecordingsResourceWithStreamingResponse(self)
|
|
181
|
+
|
|
182
|
+
async def list(
|
|
183
|
+
self,
|
|
184
|
+
session_id: str,
|
|
185
|
+
*,
|
|
186
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
187
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
188
|
+
extra_headers: Headers | None = None,
|
|
189
|
+
extra_query: Query | None = None,
|
|
190
|
+
extra_body: Body | None = None,
|
|
191
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
192
|
+
) -> RecordingListResponse:
|
|
193
|
+
"""Retrieves the URLs of the browser session's video recordings.
|
|
194
|
+
|
|
195
|
+
Requires a valid
|
|
196
|
+
API key for authentication.
|
|
197
|
+
|
|
198
|
+
Args:
|
|
199
|
+
extra_headers: Send extra headers
|
|
200
|
+
|
|
201
|
+
extra_query: Add additional query parameters to the request
|
|
202
|
+
|
|
203
|
+
extra_body: Add additional JSON properties to the request
|
|
204
|
+
|
|
205
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
206
|
+
"""
|
|
207
|
+
if not session_id:
|
|
208
|
+
raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
|
|
209
|
+
return await self._get(
|
|
210
|
+
f"/v1/sessions/{session_id}/recordings",
|
|
211
|
+
options=make_request_options(
|
|
212
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
213
|
+
),
|
|
214
|
+
cast_to=RecordingListResponse,
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
async def pause(
|
|
218
|
+
self,
|
|
219
|
+
session_id: str,
|
|
220
|
+
*,
|
|
221
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
222
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
223
|
+
extra_headers: Headers | None = None,
|
|
224
|
+
extra_query: Query | None = None,
|
|
225
|
+
extra_body: Body | None = None,
|
|
226
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
227
|
+
) -> RecordingPauseResponse:
|
|
228
|
+
"""
|
|
229
|
+
Pauses the video recording for the specified browser session.
|
|
230
|
+
|
|
231
|
+
Args:
|
|
232
|
+
extra_headers: Send extra headers
|
|
233
|
+
|
|
234
|
+
extra_query: Add additional query parameters to the request
|
|
235
|
+
|
|
236
|
+
extra_body: Add additional JSON properties to the request
|
|
237
|
+
|
|
238
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
239
|
+
"""
|
|
240
|
+
if not session_id:
|
|
241
|
+
raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
|
|
242
|
+
return await self._post(
|
|
243
|
+
f"/v1/sessions/{session_id}/recordings/pause",
|
|
244
|
+
options=make_request_options(
|
|
245
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
246
|
+
),
|
|
247
|
+
cast_to=RecordingPauseResponse,
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
async def resume(
|
|
251
|
+
self,
|
|
252
|
+
session_id: str,
|
|
253
|
+
*,
|
|
254
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
255
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
256
|
+
extra_headers: Headers | None = None,
|
|
257
|
+
extra_query: Query | None = None,
|
|
258
|
+
extra_body: Body | None = None,
|
|
259
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
260
|
+
) -> RecordingResumeResponse:
|
|
261
|
+
"""
|
|
262
|
+
Resumes the video recording for the specified browser session.
|
|
263
|
+
|
|
264
|
+
Args:
|
|
265
|
+
extra_headers: Send extra headers
|
|
266
|
+
|
|
267
|
+
extra_query: Add additional query parameters to the request
|
|
268
|
+
|
|
269
|
+
extra_body: Add additional JSON properties to the request
|
|
270
|
+
|
|
271
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
272
|
+
"""
|
|
273
|
+
if not session_id:
|
|
274
|
+
raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
|
|
275
|
+
return await self._post(
|
|
276
|
+
f"/v1/sessions/{session_id}/recordings/resume",
|
|
277
|
+
options=make_request_options(
|
|
278
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
279
|
+
),
|
|
280
|
+
cast_to=RecordingResumeResponse,
|
|
281
|
+
)
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
class RecordingsResourceWithRawResponse:
|
|
285
|
+
def __init__(self, recordings: RecordingsResource) -> None:
|
|
286
|
+
self._recordings = recordings
|
|
287
|
+
|
|
288
|
+
self.list = to_raw_response_wrapper(
|
|
289
|
+
recordings.list,
|
|
290
|
+
)
|
|
291
|
+
self.pause = to_raw_response_wrapper(
|
|
292
|
+
recordings.pause,
|
|
293
|
+
)
|
|
294
|
+
self.resume = to_raw_response_wrapper(
|
|
295
|
+
recordings.resume,
|
|
296
|
+
)
|
|
297
|
+
|
|
298
|
+
@cached_property
|
|
299
|
+
def primary(self) -> PrimaryResourceWithRawResponse:
|
|
300
|
+
return PrimaryResourceWithRawResponse(self._recordings.primary)
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
class AsyncRecordingsResourceWithRawResponse:
|
|
304
|
+
def __init__(self, recordings: AsyncRecordingsResource) -> None:
|
|
305
|
+
self._recordings = recordings
|
|
306
|
+
|
|
307
|
+
self.list = async_to_raw_response_wrapper(
|
|
308
|
+
recordings.list,
|
|
309
|
+
)
|
|
310
|
+
self.pause = async_to_raw_response_wrapper(
|
|
311
|
+
recordings.pause,
|
|
312
|
+
)
|
|
313
|
+
self.resume = async_to_raw_response_wrapper(
|
|
314
|
+
recordings.resume,
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
@cached_property
|
|
318
|
+
def primary(self) -> AsyncPrimaryResourceWithRawResponse:
|
|
319
|
+
return AsyncPrimaryResourceWithRawResponse(self._recordings.primary)
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
class RecordingsResourceWithStreamingResponse:
|
|
323
|
+
def __init__(self, recordings: RecordingsResource) -> None:
|
|
324
|
+
self._recordings = recordings
|
|
325
|
+
|
|
326
|
+
self.list = to_streamed_response_wrapper(
|
|
327
|
+
recordings.list,
|
|
328
|
+
)
|
|
329
|
+
self.pause = to_streamed_response_wrapper(
|
|
330
|
+
recordings.pause,
|
|
331
|
+
)
|
|
332
|
+
self.resume = to_streamed_response_wrapper(
|
|
333
|
+
recordings.resume,
|
|
334
|
+
)
|
|
335
|
+
|
|
336
|
+
@cached_property
|
|
337
|
+
def primary(self) -> PrimaryResourceWithStreamingResponse:
|
|
338
|
+
return PrimaryResourceWithStreamingResponse(self._recordings.primary)
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
class AsyncRecordingsResourceWithStreamingResponse:
|
|
342
|
+
def __init__(self, recordings: AsyncRecordingsResource) -> None:
|
|
343
|
+
self._recordings = recordings
|
|
344
|
+
|
|
345
|
+
self.list = async_to_streamed_response_wrapper(
|
|
346
|
+
recordings.list,
|
|
347
|
+
)
|
|
348
|
+
self.pause = async_to_streamed_response_wrapper(
|
|
349
|
+
recordings.pause,
|
|
350
|
+
)
|
|
351
|
+
self.resume = async_to_streamed_response_wrapper(
|
|
352
|
+
recordings.resume,
|
|
353
|
+
)
|
|
354
|
+
|
|
355
|
+
@cached_property
|
|
356
|
+
def primary(self) -> AsyncPrimaryResourceWithStreamingResponse:
|
|
357
|
+
return AsyncPrimaryResourceWithStreamingResponse(self._recordings.primary)
|