anchorbrowser 0.1.1__py3-none-any.whl → 0.3.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/_client.py +17 -1
- anchorbrowser/_models.py +3 -0
- anchorbrowser/_version.py +1 -1
- anchorbrowser/resources/__init__.py +28 -0
- anchorbrowser/resources/batch_sessions.py +288 -0
- anchorbrowser/resources/profiles.py +1 -115
- anchorbrowser/resources/sessions/__init__.py +14 -0
- anchorbrowser/resources/sessions/agent/__init__.py +33 -0
- anchorbrowser/resources/sessions/agent/agent.py +273 -0
- anchorbrowser/resources/sessions/agent/files.py +280 -0
- anchorbrowser/resources/sessions/mouse.py +1 -233
- anchorbrowser/resources/sessions/sessions.py +39 -1
- anchorbrowser/resources/task.py +465 -0
- anchorbrowser/types/__init__.py +7 -1
- anchorbrowser/types/batch_session_create_params.py +487 -0
- anchorbrowser/types/batch_session_create_response.py +27 -0
- anchorbrowser/types/batch_session_retrieve_response.py +90 -0
- anchorbrowser/types/session_create_params.py +52 -9
- anchorbrowser/types/sessions/__init__.py +0 -4
- anchorbrowser/types/sessions/agent/__init__.py +7 -0
- anchorbrowser/types/sessions/agent/file_list_response.py +32 -0
- anchorbrowser/types/sessions/agent/file_upload_params.py +14 -0
- anchorbrowser/types/sessions/agent/file_upload_response.py +17 -0
- anchorbrowser/types/task/__init__.py +6 -0
- anchorbrowser/types/task/run_execute_params.py +324 -0
- anchorbrowser/types/task/run_execute_response.py +33 -0
- anchorbrowser/types/task_create_params.py +317 -0
- anchorbrowser/types/task_create_response.py +345 -0
- anchorbrowser/types/task_list_params.py +15 -0
- anchorbrowser/types/task_list_response.py +361 -0
- {anchorbrowser-0.1.1.dist-info → anchorbrowser-0.3.0.dist-info}/METADATA +6 -6
- {anchorbrowser-0.1.1.dist-info → anchorbrowser-0.3.0.dist-info}/RECORD +34 -20
- anchorbrowser/types/profile_update_params.py +0 -21
- anchorbrowser/types/sessions/mouse_down_params.py +0 -18
- anchorbrowser/types/sessions/mouse_down_response.py +0 -11
- anchorbrowser/types/sessions/mouse_up_params.py +0 -18
- anchorbrowser/types/sessions/mouse_up_response.py +0 -11
- {anchorbrowser-0.1.1.dist-info → anchorbrowser-0.3.0.dist-info}/WHEEL +0 -0
- {anchorbrowser-0.1.1.dist-info → anchorbrowser-0.3.0.dist-info}/licenses/LICENSE +0 -0
anchorbrowser/_client.py
CHANGED
|
@@ -21,7 +21,7 @@ from ._types import (
|
|
|
21
21
|
)
|
|
22
22
|
from ._utils import is_given, get_async_library
|
|
23
23
|
from ._version import __version__
|
|
24
|
-
from .resources import agent, tools, events, browser, profiles, extensions
|
|
24
|
+
from .resources import task, agent, tools, events, browser, profiles, extensions, batch_sessions
|
|
25
25
|
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
|
|
26
26
|
from ._exceptions import APIStatusError, AnchorbrowserError
|
|
27
27
|
from ._base_client import (
|
|
@@ -51,6 +51,8 @@ class Anchorbrowser(SyncAPIClient):
|
|
|
51
51
|
browser: browser.BrowserResource
|
|
52
52
|
agent: agent.AgentResource
|
|
53
53
|
events: events.EventsResource
|
|
54
|
+
batch_sessions: batch_sessions.BatchSessionsResource
|
|
55
|
+
task: task.TaskResource
|
|
54
56
|
with_raw_response: AnchorbrowserWithRawResponse
|
|
55
57
|
with_streaming_response: AnchorbrowserWithStreamedResponse
|
|
56
58
|
|
|
@@ -115,6 +117,8 @@ class Anchorbrowser(SyncAPIClient):
|
|
|
115
117
|
self.browser = browser.BrowserResource(self)
|
|
116
118
|
self.agent = agent.AgentResource(self)
|
|
117
119
|
self.events = events.EventsResource(self)
|
|
120
|
+
self.batch_sessions = batch_sessions.BatchSessionsResource(self)
|
|
121
|
+
self.task = task.TaskResource(self)
|
|
118
122
|
self.with_raw_response = AnchorbrowserWithRawResponse(self)
|
|
119
123
|
self.with_streaming_response = AnchorbrowserWithStreamedResponse(self)
|
|
120
124
|
|
|
@@ -231,6 +235,8 @@ class AsyncAnchorbrowser(AsyncAPIClient):
|
|
|
231
235
|
browser: browser.AsyncBrowserResource
|
|
232
236
|
agent: agent.AsyncAgentResource
|
|
233
237
|
events: events.AsyncEventsResource
|
|
238
|
+
batch_sessions: batch_sessions.AsyncBatchSessionsResource
|
|
239
|
+
task: task.AsyncTaskResource
|
|
234
240
|
with_raw_response: AsyncAnchorbrowserWithRawResponse
|
|
235
241
|
with_streaming_response: AsyncAnchorbrowserWithStreamedResponse
|
|
236
242
|
|
|
@@ -295,6 +301,8 @@ class AsyncAnchorbrowser(AsyncAPIClient):
|
|
|
295
301
|
self.browser = browser.AsyncBrowserResource(self)
|
|
296
302
|
self.agent = agent.AsyncAgentResource(self)
|
|
297
303
|
self.events = events.AsyncEventsResource(self)
|
|
304
|
+
self.batch_sessions = batch_sessions.AsyncBatchSessionsResource(self)
|
|
305
|
+
self.task = task.AsyncTaskResource(self)
|
|
298
306
|
self.with_raw_response = AsyncAnchorbrowserWithRawResponse(self)
|
|
299
307
|
self.with_streaming_response = AsyncAnchorbrowserWithStreamedResponse(self)
|
|
300
308
|
|
|
@@ -412,6 +420,8 @@ class AnchorbrowserWithRawResponse:
|
|
|
412
420
|
self.browser = browser.BrowserResourceWithRawResponse(client.browser)
|
|
413
421
|
self.agent = agent.AgentResourceWithRawResponse(client.agent)
|
|
414
422
|
self.events = events.EventsResourceWithRawResponse(client.events)
|
|
423
|
+
self.batch_sessions = batch_sessions.BatchSessionsResourceWithRawResponse(client.batch_sessions)
|
|
424
|
+
self.task = task.TaskResourceWithRawResponse(client.task)
|
|
415
425
|
|
|
416
426
|
|
|
417
427
|
class AsyncAnchorbrowserWithRawResponse:
|
|
@@ -423,6 +433,8 @@ class AsyncAnchorbrowserWithRawResponse:
|
|
|
423
433
|
self.browser = browser.AsyncBrowserResourceWithRawResponse(client.browser)
|
|
424
434
|
self.agent = agent.AsyncAgentResourceWithRawResponse(client.agent)
|
|
425
435
|
self.events = events.AsyncEventsResourceWithRawResponse(client.events)
|
|
436
|
+
self.batch_sessions = batch_sessions.AsyncBatchSessionsResourceWithRawResponse(client.batch_sessions)
|
|
437
|
+
self.task = task.AsyncTaskResourceWithRawResponse(client.task)
|
|
426
438
|
|
|
427
439
|
|
|
428
440
|
class AnchorbrowserWithStreamedResponse:
|
|
@@ -434,6 +446,8 @@ class AnchorbrowserWithStreamedResponse:
|
|
|
434
446
|
self.browser = browser.BrowserResourceWithStreamingResponse(client.browser)
|
|
435
447
|
self.agent = agent.AgentResourceWithStreamingResponse(client.agent)
|
|
436
448
|
self.events = events.EventsResourceWithStreamingResponse(client.events)
|
|
449
|
+
self.batch_sessions = batch_sessions.BatchSessionsResourceWithStreamingResponse(client.batch_sessions)
|
|
450
|
+
self.task = task.TaskResourceWithStreamingResponse(client.task)
|
|
437
451
|
|
|
438
452
|
|
|
439
453
|
class AsyncAnchorbrowserWithStreamedResponse:
|
|
@@ -445,6 +459,8 @@ class AsyncAnchorbrowserWithStreamedResponse:
|
|
|
445
459
|
self.browser = browser.AsyncBrowserResourceWithStreamingResponse(client.browser)
|
|
446
460
|
self.agent = agent.AsyncAgentResourceWithStreamingResponse(client.agent)
|
|
447
461
|
self.events = events.AsyncEventsResourceWithStreamingResponse(client.events)
|
|
462
|
+
self.batch_sessions = batch_sessions.AsyncBatchSessionsResourceWithStreamingResponse(client.batch_sessions)
|
|
463
|
+
self.task = task.AsyncTaskResourceWithStreamingResponse(client.task)
|
|
448
464
|
|
|
449
465
|
|
|
450
466
|
Client = Anchorbrowser
|
anchorbrowser/_models.py
CHANGED
|
@@ -260,6 +260,7 @@ class BaseModel(pydantic.BaseModel):
|
|
|
260
260
|
exclude_unset: bool = False,
|
|
261
261
|
exclude_defaults: bool = False,
|
|
262
262
|
exclude_none: bool = False,
|
|
263
|
+
exclude_computed_fields: bool = False,
|
|
263
264
|
round_trip: bool = False,
|
|
264
265
|
warnings: bool | Literal["none", "warn", "error"] = True,
|
|
265
266
|
context: dict[str, Any] | None = None,
|
|
@@ -320,11 +321,13 @@ class BaseModel(pydantic.BaseModel):
|
|
|
320
321
|
exclude_unset: bool = False,
|
|
321
322
|
exclude_defaults: bool = False,
|
|
322
323
|
exclude_none: bool = False,
|
|
324
|
+
exclude_computed_fields: bool = False,
|
|
323
325
|
round_trip: bool = False,
|
|
324
326
|
warnings: bool | Literal["none", "warn", "error"] = True,
|
|
325
327
|
context: dict[str, Any] | None = None,
|
|
326
328
|
fallback: Callable[[Any], Any] | None = None,
|
|
327
329
|
serialize_as_any: bool = False,
|
|
330
|
+
ensure_ascii: bool = True,
|
|
328
331
|
) -> str:
|
|
329
332
|
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json
|
|
330
333
|
|
anchorbrowser/_version.py
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
from .task import (
|
|
4
|
+
TaskResource,
|
|
5
|
+
AsyncTaskResource,
|
|
6
|
+
TaskResourceWithRawResponse,
|
|
7
|
+
AsyncTaskResourceWithRawResponse,
|
|
8
|
+
TaskResourceWithStreamingResponse,
|
|
9
|
+
AsyncTaskResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
3
11
|
from .tools import (
|
|
4
12
|
ToolsResource,
|
|
5
13
|
AsyncToolsResource,
|
|
@@ -40,6 +48,14 @@ from .extensions import (
|
|
|
40
48
|
ExtensionsResourceWithStreamingResponse,
|
|
41
49
|
AsyncExtensionsResourceWithStreamingResponse,
|
|
42
50
|
)
|
|
51
|
+
from .batch_sessions import (
|
|
52
|
+
BatchSessionsResource,
|
|
53
|
+
AsyncBatchSessionsResource,
|
|
54
|
+
BatchSessionsResourceWithRawResponse,
|
|
55
|
+
AsyncBatchSessionsResourceWithRawResponse,
|
|
56
|
+
BatchSessionsResourceWithStreamingResponse,
|
|
57
|
+
AsyncBatchSessionsResourceWithStreamingResponse,
|
|
58
|
+
)
|
|
43
59
|
|
|
44
60
|
__all__ = [
|
|
45
61
|
"ProfilesResource",
|
|
@@ -72,4 +88,16 @@ __all__ = [
|
|
|
72
88
|
"AsyncEventsResourceWithRawResponse",
|
|
73
89
|
"EventsResourceWithStreamingResponse",
|
|
74
90
|
"AsyncEventsResourceWithStreamingResponse",
|
|
91
|
+
"BatchSessionsResource",
|
|
92
|
+
"AsyncBatchSessionsResource",
|
|
93
|
+
"BatchSessionsResourceWithRawResponse",
|
|
94
|
+
"AsyncBatchSessionsResourceWithRawResponse",
|
|
95
|
+
"BatchSessionsResourceWithStreamingResponse",
|
|
96
|
+
"AsyncBatchSessionsResourceWithStreamingResponse",
|
|
97
|
+
"TaskResource",
|
|
98
|
+
"AsyncTaskResource",
|
|
99
|
+
"TaskResourceWithRawResponse",
|
|
100
|
+
"AsyncTaskResourceWithRawResponse",
|
|
101
|
+
"TaskResourceWithStreamingResponse",
|
|
102
|
+
"AsyncTaskResourceWithStreamingResponse",
|
|
75
103
|
]
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Dict
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ..types import batch_session_create_params
|
|
10
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
11
|
+
from .._utils import maybe_transform, async_maybe_transform
|
|
12
|
+
from .._compat import cached_property
|
|
13
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
14
|
+
from .._response import (
|
|
15
|
+
to_raw_response_wrapper,
|
|
16
|
+
to_streamed_response_wrapper,
|
|
17
|
+
async_to_raw_response_wrapper,
|
|
18
|
+
async_to_streamed_response_wrapper,
|
|
19
|
+
)
|
|
20
|
+
from .._base_client import make_request_options
|
|
21
|
+
from ..types.batch_session_create_response import BatchSessionCreateResponse
|
|
22
|
+
from ..types.batch_session_retrieve_response import BatchSessionRetrieveResponse
|
|
23
|
+
|
|
24
|
+
__all__ = ["BatchSessionsResource", "AsyncBatchSessionsResource"]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class BatchSessionsResource(SyncAPIResource):
|
|
28
|
+
@cached_property
|
|
29
|
+
def with_raw_response(self) -> BatchSessionsResourceWithRawResponse:
|
|
30
|
+
"""
|
|
31
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
32
|
+
the raw response object instead of the parsed content.
|
|
33
|
+
|
|
34
|
+
For more information, see https://www.github.com/anchorbrowser/AnchorBrowser-SDK-Python#accessing-raw-response-data-eg-headers
|
|
35
|
+
"""
|
|
36
|
+
return BatchSessionsResourceWithRawResponse(self)
|
|
37
|
+
|
|
38
|
+
@cached_property
|
|
39
|
+
def with_streaming_response(self) -> BatchSessionsResourceWithStreamingResponse:
|
|
40
|
+
"""
|
|
41
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
42
|
+
|
|
43
|
+
For more information, see https://www.github.com/anchorbrowser/AnchorBrowser-SDK-Python#with_streaming_response
|
|
44
|
+
"""
|
|
45
|
+
return BatchSessionsResourceWithStreamingResponse(self)
|
|
46
|
+
|
|
47
|
+
def create(
|
|
48
|
+
self,
|
|
49
|
+
*,
|
|
50
|
+
count: int,
|
|
51
|
+
configuration: batch_session_create_params.Configuration | Omit = omit,
|
|
52
|
+
metadata: Dict[str, object] | Omit = omit,
|
|
53
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
54
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
55
|
+
extra_headers: Headers | None = None,
|
|
56
|
+
extra_query: Query | None = None,
|
|
57
|
+
extra_body: Body | None = None,
|
|
58
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
59
|
+
) -> BatchSessionCreateResponse:
|
|
60
|
+
"""Creates multiple browser sessions in a single batch operation.
|
|
61
|
+
|
|
62
|
+
This endpoint
|
|
63
|
+
allows you to create up to 5,000 browser sessions simultaneously with the same
|
|
64
|
+
configuration.
|
|
65
|
+
|
|
66
|
+
The batch will be processed asynchronously, and you can monitor progress using
|
|
67
|
+
the batch status endpoint.
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
count: Number of sessions to create in the batch (1-1000)
|
|
71
|
+
|
|
72
|
+
configuration: Configuration that applies to all sessions in the batch
|
|
73
|
+
|
|
74
|
+
metadata: Optional batch-level metadata for identification and organization
|
|
75
|
+
|
|
76
|
+
extra_headers: Send extra headers
|
|
77
|
+
|
|
78
|
+
extra_query: Add additional query parameters to the request
|
|
79
|
+
|
|
80
|
+
extra_body: Add additional JSON properties to the request
|
|
81
|
+
|
|
82
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
83
|
+
"""
|
|
84
|
+
return self._post(
|
|
85
|
+
"/v1/batch-sessions",
|
|
86
|
+
body=maybe_transform(
|
|
87
|
+
{
|
|
88
|
+
"count": count,
|
|
89
|
+
"configuration": configuration,
|
|
90
|
+
"metadata": metadata,
|
|
91
|
+
},
|
|
92
|
+
batch_session_create_params.BatchSessionCreateParams,
|
|
93
|
+
),
|
|
94
|
+
options=make_request_options(
|
|
95
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
96
|
+
),
|
|
97
|
+
cast_to=BatchSessionCreateResponse,
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
def retrieve(
|
|
101
|
+
self,
|
|
102
|
+
batch_id: str,
|
|
103
|
+
*,
|
|
104
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
105
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
106
|
+
extra_headers: Headers | None = None,
|
|
107
|
+
extra_query: Query | None = None,
|
|
108
|
+
extra_body: Body | None = None,
|
|
109
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
110
|
+
) -> BatchSessionRetrieveResponse:
|
|
111
|
+
"""
|
|
112
|
+
Retrieves detailed status information for a specific batch, including progress,
|
|
113
|
+
individual session details, and any errors that occurred.
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
extra_headers: Send extra headers
|
|
117
|
+
|
|
118
|
+
extra_query: Add additional query parameters to the request
|
|
119
|
+
|
|
120
|
+
extra_body: Add additional JSON properties to the request
|
|
121
|
+
|
|
122
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
123
|
+
"""
|
|
124
|
+
if not batch_id:
|
|
125
|
+
raise ValueError(f"Expected a non-empty value for `batch_id` but received {batch_id!r}")
|
|
126
|
+
return self._get(
|
|
127
|
+
f"/v1/batch-sessions/{batch_id}",
|
|
128
|
+
options=make_request_options(
|
|
129
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
130
|
+
),
|
|
131
|
+
cast_to=BatchSessionRetrieveResponse,
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
class AsyncBatchSessionsResource(AsyncAPIResource):
|
|
136
|
+
@cached_property
|
|
137
|
+
def with_raw_response(self) -> AsyncBatchSessionsResourceWithRawResponse:
|
|
138
|
+
"""
|
|
139
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
140
|
+
the raw response object instead of the parsed content.
|
|
141
|
+
|
|
142
|
+
For more information, see https://www.github.com/anchorbrowser/AnchorBrowser-SDK-Python#accessing-raw-response-data-eg-headers
|
|
143
|
+
"""
|
|
144
|
+
return AsyncBatchSessionsResourceWithRawResponse(self)
|
|
145
|
+
|
|
146
|
+
@cached_property
|
|
147
|
+
def with_streaming_response(self) -> AsyncBatchSessionsResourceWithStreamingResponse:
|
|
148
|
+
"""
|
|
149
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
150
|
+
|
|
151
|
+
For more information, see https://www.github.com/anchorbrowser/AnchorBrowser-SDK-Python#with_streaming_response
|
|
152
|
+
"""
|
|
153
|
+
return AsyncBatchSessionsResourceWithStreamingResponse(self)
|
|
154
|
+
|
|
155
|
+
async def create(
|
|
156
|
+
self,
|
|
157
|
+
*,
|
|
158
|
+
count: int,
|
|
159
|
+
configuration: batch_session_create_params.Configuration | Omit = omit,
|
|
160
|
+
metadata: Dict[str, object] | Omit = omit,
|
|
161
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
162
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
163
|
+
extra_headers: Headers | None = None,
|
|
164
|
+
extra_query: Query | None = None,
|
|
165
|
+
extra_body: Body | None = None,
|
|
166
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
167
|
+
) -> BatchSessionCreateResponse:
|
|
168
|
+
"""Creates multiple browser sessions in a single batch operation.
|
|
169
|
+
|
|
170
|
+
This endpoint
|
|
171
|
+
allows you to create up to 5,000 browser sessions simultaneously with the same
|
|
172
|
+
configuration.
|
|
173
|
+
|
|
174
|
+
The batch will be processed asynchronously, and you can monitor progress using
|
|
175
|
+
the batch status endpoint.
|
|
176
|
+
|
|
177
|
+
Args:
|
|
178
|
+
count: Number of sessions to create in the batch (1-1000)
|
|
179
|
+
|
|
180
|
+
configuration: Configuration that applies to all sessions in the batch
|
|
181
|
+
|
|
182
|
+
metadata: Optional batch-level metadata for identification and organization
|
|
183
|
+
|
|
184
|
+
extra_headers: Send extra headers
|
|
185
|
+
|
|
186
|
+
extra_query: Add additional query parameters to the request
|
|
187
|
+
|
|
188
|
+
extra_body: Add additional JSON properties to the request
|
|
189
|
+
|
|
190
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
191
|
+
"""
|
|
192
|
+
return await self._post(
|
|
193
|
+
"/v1/batch-sessions",
|
|
194
|
+
body=await async_maybe_transform(
|
|
195
|
+
{
|
|
196
|
+
"count": count,
|
|
197
|
+
"configuration": configuration,
|
|
198
|
+
"metadata": metadata,
|
|
199
|
+
},
|
|
200
|
+
batch_session_create_params.BatchSessionCreateParams,
|
|
201
|
+
),
|
|
202
|
+
options=make_request_options(
|
|
203
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
204
|
+
),
|
|
205
|
+
cast_to=BatchSessionCreateResponse,
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
async def retrieve(
|
|
209
|
+
self,
|
|
210
|
+
batch_id: str,
|
|
211
|
+
*,
|
|
212
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
213
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
214
|
+
extra_headers: Headers | None = None,
|
|
215
|
+
extra_query: Query | None = None,
|
|
216
|
+
extra_body: Body | None = None,
|
|
217
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
218
|
+
) -> BatchSessionRetrieveResponse:
|
|
219
|
+
"""
|
|
220
|
+
Retrieves detailed status information for a specific batch, including progress,
|
|
221
|
+
individual session details, and any errors that occurred.
|
|
222
|
+
|
|
223
|
+
Args:
|
|
224
|
+
extra_headers: Send extra headers
|
|
225
|
+
|
|
226
|
+
extra_query: Add additional query parameters to the request
|
|
227
|
+
|
|
228
|
+
extra_body: Add additional JSON properties to the request
|
|
229
|
+
|
|
230
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
231
|
+
"""
|
|
232
|
+
if not batch_id:
|
|
233
|
+
raise ValueError(f"Expected a non-empty value for `batch_id` but received {batch_id!r}")
|
|
234
|
+
return await self._get(
|
|
235
|
+
f"/v1/batch-sessions/{batch_id}",
|
|
236
|
+
options=make_request_options(
|
|
237
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
238
|
+
),
|
|
239
|
+
cast_to=BatchSessionRetrieveResponse,
|
|
240
|
+
)
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
class BatchSessionsResourceWithRawResponse:
|
|
244
|
+
def __init__(self, batch_sessions: BatchSessionsResource) -> None:
|
|
245
|
+
self._batch_sessions = batch_sessions
|
|
246
|
+
|
|
247
|
+
self.create = to_raw_response_wrapper(
|
|
248
|
+
batch_sessions.create,
|
|
249
|
+
)
|
|
250
|
+
self.retrieve = to_raw_response_wrapper(
|
|
251
|
+
batch_sessions.retrieve,
|
|
252
|
+
)
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
class AsyncBatchSessionsResourceWithRawResponse:
|
|
256
|
+
def __init__(self, batch_sessions: AsyncBatchSessionsResource) -> None:
|
|
257
|
+
self._batch_sessions = batch_sessions
|
|
258
|
+
|
|
259
|
+
self.create = async_to_raw_response_wrapper(
|
|
260
|
+
batch_sessions.create,
|
|
261
|
+
)
|
|
262
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
263
|
+
batch_sessions.retrieve,
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
class BatchSessionsResourceWithStreamingResponse:
|
|
268
|
+
def __init__(self, batch_sessions: BatchSessionsResource) -> None:
|
|
269
|
+
self._batch_sessions = batch_sessions
|
|
270
|
+
|
|
271
|
+
self.create = to_streamed_response_wrapper(
|
|
272
|
+
batch_sessions.create,
|
|
273
|
+
)
|
|
274
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
275
|
+
batch_sessions.retrieve,
|
|
276
|
+
)
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
class AsyncBatchSessionsResourceWithStreamingResponse:
|
|
280
|
+
def __init__(self, batch_sessions: AsyncBatchSessionsResource) -> None:
|
|
281
|
+
self._batch_sessions = batch_sessions
|
|
282
|
+
|
|
283
|
+
self.create = async_to_streamed_response_wrapper(
|
|
284
|
+
batch_sessions.create,
|
|
285
|
+
)
|
|
286
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
287
|
+
batch_sessions.retrieve,
|
|
288
|
+
)
|
|
@@ -6,7 +6,7 @@ from typing_extensions import Literal
|
|
|
6
6
|
|
|
7
7
|
import httpx
|
|
8
8
|
|
|
9
|
-
from ..types import profile_create_params
|
|
9
|
+
from ..types import profile_create_params
|
|
10
10
|
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
11
11
|
from .._utils import maybe_transform, async_maybe_transform
|
|
12
12
|
from .._compat import cached_property
|
|
@@ -137,57 +137,6 @@ class ProfilesResource(SyncAPIResource):
|
|
|
137
137
|
cast_to=ProfileRetrieveResponse,
|
|
138
138
|
)
|
|
139
139
|
|
|
140
|
-
def update(
|
|
141
|
-
self,
|
|
142
|
-
name: str,
|
|
143
|
-
*,
|
|
144
|
-
description: str | Omit = omit,
|
|
145
|
-
session_id: str | Omit = omit,
|
|
146
|
-
source: Literal["session"] | Omit = omit,
|
|
147
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
148
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
149
|
-
extra_headers: Headers | None = None,
|
|
150
|
-
extra_query: Query | None = None,
|
|
151
|
-
extra_body: Body | None = None,
|
|
152
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
153
|
-
) -> SuccessResponse:
|
|
154
|
-
"""
|
|
155
|
-
Updates the description or data of an existing profile using a browser session.
|
|
156
|
-
|
|
157
|
-
Args:
|
|
158
|
-
description: The new description for the profile.
|
|
159
|
-
|
|
160
|
-
session_id: The browser session ID is required if the source is set to `session`. The
|
|
161
|
-
browser session must belong to the user and be active.
|
|
162
|
-
|
|
163
|
-
source: The source of the profile data. Currently, only `session` is supported.
|
|
164
|
-
|
|
165
|
-
extra_headers: Send extra headers
|
|
166
|
-
|
|
167
|
-
extra_query: Add additional query parameters to the request
|
|
168
|
-
|
|
169
|
-
extra_body: Add additional JSON properties to the request
|
|
170
|
-
|
|
171
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
172
|
-
"""
|
|
173
|
-
if not name:
|
|
174
|
-
raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
|
|
175
|
-
return self._put(
|
|
176
|
-
f"/v1/profiles/{name}",
|
|
177
|
-
body=maybe_transform(
|
|
178
|
-
{
|
|
179
|
-
"description": description,
|
|
180
|
-
"session_id": session_id,
|
|
181
|
-
"source": source,
|
|
182
|
-
},
|
|
183
|
-
profile_update_params.ProfileUpdateParams,
|
|
184
|
-
),
|
|
185
|
-
options=make_request_options(
|
|
186
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
187
|
-
),
|
|
188
|
-
cast_to=SuccessResponse,
|
|
189
|
-
)
|
|
190
|
-
|
|
191
140
|
def list(
|
|
192
141
|
self,
|
|
193
142
|
*,
|
|
@@ -353,57 +302,6 @@ class AsyncProfilesResource(AsyncAPIResource):
|
|
|
353
302
|
cast_to=ProfileRetrieveResponse,
|
|
354
303
|
)
|
|
355
304
|
|
|
356
|
-
async def update(
|
|
357
|
-
self,
|
|
358
|
-
name: str,
|
|
359
|
-
*,
|
|
360
|
-
description: str | Omit = omit,
|
|
361
|
-
session_id: str | Omit = omit,
|
|
362
|
-
source: Literal["session"] | Omit = omit,
|
|
363
|
-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
364
|
-
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
365
|
-
extra_headers: Headers | None = None,
|
|
366
|
-
extra_query: Query | None = None,
|
|
367
|
-
extra_body: Body | None = None,
|
|
368
|
-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
369
|
-
) -> SuccessResponse:
|
|
370
|
-
"""
|
|
371
|
-
Updates the description or data of an existing profile using a browser session.
|
|
372
|
-
|
|
373
|
-
Args:
|
|
374
|
-
description: The new description for the profile.
|
|
375
|
-
|
|
376
|
-
session_id: The browser session ID is required if the source is set to `session`. The
|
|
377
|
-
browser session must belong to the user and be active.
|
|
378
|
-
|
|
379
|
-
source: The source of the profile data. Currently, only `session` is supported.
|
|
380
|
-
|
|
381
|
-
extra_headers: Send extra headers
|
|
382
|
-
|
|
383
|
-
extra_query: Add additional query parameters to the request
|
|
384
|
-
|
|
385
|
-
extra_body: Add additional JSON properties to the request
|
|
386
|
-
|
|
387
|
-
timeout: Override the client-level default timeout for this request, in seconds
|
|
388
|
-
"""
|
|
389
|
-
if not name:
|
|
390
|
-
raise ValueError(f"Expected a non-empty value for `name` but received {name!r}")
|
|
391
|
-
return await self._put(
|
|
392
|
-
f"/v1/profiles/{name}",
|
|
393
|
-
body=await async_maybe_transform(
|
|
394
|
-
{
|
|
395
|
-
"description": description,
|
|
396
|
-
"session_id": session_id,
|
|
397
|
-
"source": source,
|
|
398
|
-
},
|
|
399
|
-
profile_update_params.ProfileUpdateParams,
|
|
400
|
-
),
|
|
401
|
-
options=make_request_options(
|
|
402
|
-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
403
|
-
),
|
|
404
|
-
cast_to=SuccessResponse,
|
|
405
|
-
)
|
|
406
|
-
|
|
407
305
|
async def list(
|
|
408
306
|
self,
|
|
409
307
|
*,
|
|
@@ -467,9 +365,6 @@ class ProfilesResourceWithRawResponse:
|
|
|
467
365
|
self.retrieve = to_raw_response_wrapper(
|
|
468
366
|
profiles.retrieve,
|
|
469
367
|
)
|
|
470
|
-
self.update = to_raw_response_wrapper(
|
|
471
|
-
profiles.update,
|
|
472
|
-
)
|
|
473
368
|
self.list = to_raw_response_wrapper(
|
|
474
369
|
profiles.list,
|
|
475
370
|
)
|
|
@@ -488,9 +383,6 @@ class AsyncProfilesResourceWithRawResponse:
|
|
|
488
383
|
self.retrieve = async_to_raw_response_wrapper(
|
|
489
384
|
profiles.retrieve,
|
|
490
385
|
)
|
|
491
|
-
self.update = async_to_raw_response_wrapper(
|
|
492
|
-
profiles.update,
|
|
493
|
-
)
|
|
494
386
|
self.list = async_to_raw_response_wrapper(
|
|
495
387
|
profiles.list,
|
|
496
388
|
)
|
|
@@ -509,9 +401,6 @@ class ProfilesResourceWithStreamingResponse:
|
|
|
509
401
|
self.retrieve = to_streamed_response_wrapper(
|
|
510
402
|
profiles.retrieve,
|
|
511
403
|
)
|
|
512
|
-
self.update = to_streamed_response_wrapper(
|
|
513
|
-
profiles.update,
|
|
514
|
-
)
|
|
515
404
|
self.list = to_streamed_response_wrapper(
|
|
516
405
|
profiles.list,
|
|
517
406
|
)
|
|
@@ -530,9 +419,6 @@ class AsyncProfilesResourceWithStreamingResponse:
|
|
|
530
419
|
self.retrieve = async_to_streamed_response_wrapper(
|
|
531
420
|
profiles.retrieve,
|
|
532
421
|
)
|
|
533
|
-
self.update = async_to_streamed_response_wrapper(
|
|
534
|
-
profiles.update,
|
|
535
|
-
)
|
|
536
422
|
self.list = async_to_streamed_response_wrapper(
|
|
537
423
|
profiles.list,
|
|
538
424
|
)
|
|
@@ -8,6 +8,14 @@ from .all import (
|
|
|
8
8
|
AllResourceWithStreamingResponse,
|
|
9
9
|
AsyncAllResourceWithStreamingResponse,
|
|
10
10
|
)
|
|
11
|
+
from .agent import (
|
|
12
|
+
AgentResource,
|
|
13
|
+
AsyncAgentResource,
|
|
14
|
+
AgentResourceWithRawResponse,
|
|
15
|
+
AsyncAgentResourceWithRawResponse,
|
|
16
|
+
AgentResourceWithStreamingResponse,
|
|
17
|
+
AsyncAgentResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
11
19
|
from .mouse import (
|
|
12
20
|
MouseResource,
|
|
13
21
|
AsyncMouseResource,
|
|
@@ -78,6 +86,12 @@ __all__ = [
|
|
|
78
86
|
"AsyncClipboardResource",
|
|
79
87
|
"ClipboardResourceWithRawResponse",
|
|
80
88
|
"AsyncClipboardResourceWithRawResponse",
|
|
89
|
+
"AgentResource",
|
|
90
|
+
"AsyncAgentResource",
|
|
91
|
+
"AgentResourceWithRawResponse",
|
|
92
|
+
"AsyncAgentResourceWithRawResponse",
|
|
93
|
+
"AgentResourceWithStreamingResponse",
|
|
94
|
+
"AsyncAgentResourceWithStreamingResponse",
|
|
81
95
|
"ClipboardResourceWithStreamingResponse",
|
|
82
96
|
"AsyncClipboardResourceWithStreamingResponse",
|
|
83
97
|
"SessionsResource",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .agent import (
|
|
4
|
+
AgentResource,
|
|
5
|
+
AsyncAgentResource,
|
|
6
|
+
AgentResourceWithRawResponse,
|
|
7
|
+
AsyncAgentResourceWithRawResponse,
|
|
8
|
+
AgentResourceWithStreamingResponse,
|
|
9
|
+
AsyncAgentResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
11
|
+
from .files import (
|
|
12
|
+
FilesResource,
|
|
13
|
+
AsyncFilesResource,
|
|
14
|
+
FilesResourceWithRawResponse,
|
|
15
|
+
AsyncFilesResourceWithRawResponse,
|
|
16
|
+
FilesResourceWithStreamingResponse,
|
|
17
|
+
AsyncFilesResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"FilesResource",
|
|
22
|
+
"AsyncFilesResource",
|
|
23
|
+
"FilesResourceWithRawResponse",
|
|
24
|
+
"AsyncFilesResourceWithRawResponse",
|
|
25
|
+
"FilesResourceWithStreamingResponse",
|
|
26
|
+
"AsyncFilesResourceWithStreamingResponse",
|
|
27
|
+
"AgentResource",
|
|
28
|
+
"AsyncAgentResource",
|
|
29
|
+
"AgentResourceWithRawResponse",
|
|
30
|
+
"AsyncAgentResourceWithRawResponse",
|
|
31
|
+
"AgentResourceWithStreamingResponse",
|
|
32
|
+
"AsyncAgentResourceWithStreamingResponse",
|
|
33
|
+
]
|