raccoonai 0.1.0a1__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.
Potentially problematic release.
This version of raccoonai might be problematic. Click here for more details.
- raccoonai/__init__.py +96 -0
- raccoonai/_base_client.py +2051 -0
- raccoonai/_client.py +473 -0
- raccoonai/_compat.py +219 -0
- raccoonai/_constants.py +14 -0
- raccoonai/_exceptions.py +108 -0
- raccoonai/_files.py +123 -0
- raccoonai/_models.py +795 -0
- raccoonai/_qs.py +150 -0
- raccoonai/_resource.py +43 -0
- raccoonai/_response.py +830 -0
- raccoonai/_streaming.py +333 -0
- raccoonai/_types.py +217 -0
- raccoonai/_utils/__init__.py +57 -0
- raccoonai/_utils/_logs.py +25 -0
- raccoonai/_utils/_proxy.py +62 -0
- raccoonai/_utils/_reflection.py +42 -0
- raccoonai/_utils/_streams.py +12 -0
- raccoonai/_utils/_sync.py +71 -0
- raccoonai/_utils/_transform.py +392 -0
- raccoonai/_utils/_typing.py +149 -0
- raccoonai/_utils/_utils.py +414 -0
- raccoonai/_version.py +4 -0
- raccoonai/lib/.keep +4 -0
- raccoonai/py.typed +0 -0
- raccoonai/resources/__init__.py +33 -0
- raccoonai/resources/fleet.py +485 -0
- raccoonai/resources/lam.py +1161 -0
- raccoonai/types/__init__.py +15 -0
- raccoonai/types/fleet_create_params.py +77 -0
- raccoonai/types/fleet_create_response.py +20 -0
- raccoonai/types/fleet_logs_response.py +14 -0
- raccoonai/types/fleet_status_response.py +17 -0
- raccoonai/types/fleet_terminate_response.py +17 -0
- raccoonai/types/lam_extract_params.py +51 -0
- raccoonai/types/lam_extract_response.py +28 -0
- raccoonai/types/lam_integration_run_params.py +35 -0
- raccoonai/types/lam_integration_run_response.py +47 -0
- raccoonai/types/lam_run_params.py +41 -0
- raccoonai/types/lam_run_response.py +21 -0
- raccoonai-0.1.0a1.dist-info/METADATA +422 -0
- raccoonai-0.1.0a1.dist-info/RECORD +44 -0
- raccoonai-0.1.0a1.dist-info/WHEEL +4 -0
- raccoonai-0.1.0a1.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,485 @@
|
|
|
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 Optional
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ..types import fleet_create_params
|
|
10
|
+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
11
|
+
from .._utils import (
|
|
12
|
+
maybe_transform,
|
|
13
|
+
async_maybe_transform,
|
|
14
|
+
)
|
|
15
|
+
from .._compat import cached_property
|
|
16
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
17
|
+
from .._response import (
|
|
18
|
+
to_raw_response_wrapper,
|
|
19
|
+
to_streamed_response_wrapper,
|
|
20
|
+
async_to_raw_response_wrapper,
|
|
21
|
+
async_to_streamed_response_wrapper,
|
|
22
|
+
)
|
|
23
|
+
from .._base_client import make_request_options
|
|
24
|
+
from ..types.fleet_logs_response import FleetLogsResponse
|
|
25
|
+
from ..types.fleet_create_response import FleetCreateResponse
|
|
26
|
+
from ..types.fleet_status_response import FleetStatusResponse
|
|
27
|
+
from ..types.fleet_terminate_response import FleetTerminateResponse
|
|
28
|
+
|
|
29
|
+
__all__ = ["FleetResource", "AsyncFleetResource"]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class FleetResource(SyncAPIResource):
|
|
33
|
+
@cached_property
|
|
34
|
+
def with_raw_response(self) -> FleetResourceWithRawResponse:
|
|
35
|
+
"""
|
|
36
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
37
|
+
the raw response object instead of the parsed content.
|
|
38
|
+
|
|
39
|
+
For more information, see https://www.github.com/flyingraccoonai/raccoonai-python#accessing-raw-response-data-eg-headers
|
|
40
|
+
"""
|
|
41
|
+
return FleetResourceWithRawResponse(self)
|
|
42
|
+
|
|
43
|
+
@cached_property
|
|
44
|
+
def with_streaming_response(self) -> FleetResourceWithStreamingResponse:
|
|
45
|
+
"""
|
|
46
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
47
|
+
|
|
48
|
+
For more information, see https://www.github.com/flyingraccoonai/raccoonai-python#with_streaming_response
|
|
49
|
+
"""
|
|
50
|
+
return FleetResourceWithStreamingResponse(self)
|
|
51
|
+
|
|
52
|
+
def create(
|
|
53
|
+
self,
|
|
54
|
+
*,
|
|
55
|
+
advanced: Optional[fleet_create_params.Advanced] | NotGiven = NOT_GIVEN,
|
|
56
|
+
app_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
57
|
+
browser_type: Optional[str] | NotGiven = NOT_GIVEN,
|
|
58
|
+
headless: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
59
|
+
raccoon_passcode: Optional[str] | NotGiven = NOT_GIVEN,
|
|
60
|
+
session_timeout: Optional[int] | NotGiven = NOT_GIVEN,
|
|
61
|
+
settings: Optional[fleet_create_params.Settings] | NotGiven = NOT_GIVEN,
|
|
62
|
+
url: Optional[str] | NotGiven = NOT_GIVEN,
|
|
63
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
64
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
65
|
+
extra_headers: Headers | None = None,
|
|
66
|
+
extra_query: Query | None = None,
|
|
67
|
+
extra_body: Body | None = None,
|
|
68
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
69
|
+
) -> FleetCreateResponse:
|
|
70
|
+
"""
|
|
71
|
+
Fleet Websocket Session Create Endpoint
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
advanced: Advanced configuration options for the session, such as ad-blocking and CAPTCHA
|
|
75
|
+
solving.
|
|
76
|
+
|
|
77
|
+
app_name: The name of the app for which the session is going to run for, used for
|
|
78
|
+
streamlining authentication.
|
|
79
|
+
|
|
80
|
+
browser_type: The type of browser to use. Supported values include 'chromium', 'firefox', and
|
|
81
|
+
'webkit'.
|
|
82
|
+
|
|
83
|
+
headless: Whether to run the browser in headless mode.
|
|
84
|
+
|
|
85
|
+
raccoon_passcode: The raccoon passcode associated with the end user on behalf of which the call is
|
|
86
|
+
being made if any.
|
|
87
|
+
|
|
88
|
+
session_timeout: The timeout for the browser session in seconds.
|
|
89
|
+
|
|
90
|
+
settings: Configuration settings for the browser, such as viewport size and User-Agent
|
|
91
|
+
string.
|
|
92
|
+
|
|
93
|
+
url: The entrypoint url for the session.
|
|
94
|
+
|
|
95
|
+
extra_headers: Send extra headers
|
|
96
|
+
|
|
97
|
+
extra_query: Add additional query parameters to the request
|
|
98
|
+
|
|
99
|
+
extra_body: Add additional JSON properties to the request
|
|
100
|
+
|
|
101
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
102
|
+
"""
|
|
103
|
+
return self._post(
|
|
104
|
+
"/sessions/create",
|
|
105
|
+
body=maybe_transform(
|
|
106
|
+
{
|
|
107
|
+
"advanced": advanced,
|
|
108
|
+
"app_name": app_name,
|
|
109
|
+
"browser_type": browser_type,
|
|
110
|
+
"headless": headless,
|
|
111
|
+
"raccoon_passcode": raccoon_passcode,
|
|
112
|
+
"session_timeout": session_timeout,
|
|
113
|
+
"settings": settings,
|
|
114
|
+
"url": url,
|
|
115
|
+
},
|
|
116
|
+
fleet_create_params.FleetCreateParams,
|
|
117
|
+
),
|
|
118
|
+
options=make_request_options(
|
|
119
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
120
|
+
),
|
|
121
|
+
cast_to=FleetCreateResponse,
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
def logs(
|
|
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
|
+
) -> FleetLogsResponse:
|
|
135
|
+
"""
|
|
136
|
+
Fleet Session Logs Endpoint
|
|
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._get(
|
|
150
|
+
f"/sessions/{session_id}/logs",
|
|
151
|
+
options=make_request_options(
|
|
152
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
153
|
+
),
|
|
154
|
+
cast_to=FleetLogsResponse,
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
def status(
|
|
158
|
+
self,
|
|
159
|
+
session_id: str,
|
|
160
|
+
*,
|
|
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
|
+
) -> FleetStatusResponse:
|
|
168
|
+
"""
|
|
169
|
+
Fleet Session Status Endpoint
|
|
170
|
+
|
|
171
|
+
Args:
|
|
172
|
+
extra_headers: Send extra headers
|
|
173
|
+
|
|
174
|
+
extra_query: Add additional query parameters to the request
|
|
175
|
+
|
|
176
|
+
extra_body: Add additional JSON properties to the request
|
|
177
|
+
|
|
178
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
179
|
+
"""
|
|
180
|
+
if not session_id:
|
|
181
|
+
raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
|
|
182
|
+
return self._get(
|
|
183
|
+
f"/sessions/{session_id}/status",
|
|
184
|
+
options=make_request_options(
|
|
185
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
186
|
+
),
|
|
187
|
+
cast_to=FleetStatusResponse,
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
def terminate(
|
|
191
|
+
self,
|
|
192
|
+
session_id: str,
|
|
193
|
+
*,
|
|
194
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
195
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
196
|
+
extra_headers: Headers | None = None,
|
|
197
|
+
extra_query: Query | None = None,
|
|
198
|
+
extra_body: Body | None = None,
|
|
199
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
200
|
+
) -> FleetTerminateResponse:
|
|
201
|
+
"""
|
|
202
|
+
Fleet Session Terminate Endpoint
|
|
203
|
+
|
|
204
|
+
Args:
|
|
205
|
+
extra_headers: Send extra headers
|
|
206
|
+
|
|
207
|
+
extra_query: Add additional query parameters to the request
|
|
208
|
+
|
|
209
|
+
extra_body: Add additional JSON properties to the request
|
|
210
|
+
|
|
211
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
212
|
+
"""
|
|
213
|
+
if not session_id:
|
|
214
|
+
raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
|
|
215
|
+
return self._delete(
|
|
216
|
+
f"/sessions/{session_id}/terminate",
|
|
217
|
+
options=make_request_options(
|
|
218
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
219
|
+
),
|
|
220
|
+
cast_to=FleetTerminateResponse,
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
class AsyncFleetResource(AsyncAPIResource):
|
|
225
|
+
@cached_property
|
|
226
|
+
def with_raw_response(self) -> AsyncFleetResourceWithRawResponse:
|
|
227
|
+
"""
|
|
228
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
229
|
+
the raw response object instead of the parsed content.
|
|
230
|
+
|
|
231
|
+
For more information, see https://www.github.com/flyingraccoonai/raccoonai-python#accessing-raw-response-data-eg-headers
|
|
232
|
+
"""
|
|
233
|
+
return AsyncFleetResourceWithRawResponse(self)
|
|
234
|
+
|
|
235
|
+
@cached_property
|
|
236
|
+
def with_streaming_response(self) -> AsyncFleetResourceWithStreamingResponse:
|
|
237
|
+
"""
|
|
238
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
239
|
+
|
|
240
|
+
For more information, see https://www.github.com/flyingraccoonai/raccoonai-python#with_streaming_response
|
|
241
|
+
"""
|
|
242
|
+
return AsyncFleetResourceWithStreamingResponse(self)
|
|
243
|
+
|
|
244
|
+
async def create(
|
|
245
|
+
self,
|
|
246
|
+
*,
|
|
247
|
+
advanced: Optional[fleet_create_params.Advanced] | NotGiven = NOT_GIVEN,
|
|
248
|
+
app_name: Optional[str] | NotGiven = NOT_GIVEN,
|
|
249
|
+
browser_type: Optional[str] | NotGiven = NOT_GIVEN,
|
|
250
|
+
headless: Optional[bool] | NotGiven = NOT_GIVEN,
|
|
251
|
+
raccoon_passcode: Optional[str] | NotGiven = NOT_GIVEN,
|
|
252
|
+
session_timeout: Optional[int] | NotGiven = NOT_GIVEN,
|
|
253
|
+
settings: Optional[fleet_create_params.Settings] | NotGiven = NOT_GIVEN,
|
|
254
|
+
url: Optional[str] | NotGiven = NOT_GIVEN,
|
|
255
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
256
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
257
|
+
extra_headers: Headers | None = None,
|
|
258
|
+
extra_query: Query | None = None,
|
|
259
|
+
extra_body: Body | None = None,
|
|
260
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
261
|
+
) -> FleetCreateResponse:
|
|
262
|
+
"""
|
|
263
|
+
Fleet Websocket Session Create Endpoint
|
|
264
|
+
|
|
265
|
+
Args:
|
|
266
|
+
advanced: Advanced configuration options for the session, such as ad-blocking and CAPTCHA
|
|
267
|
+
solving.
|
|
268
|
+
|
|
269
|
+
app_name: The name of the app for which the session is going to run for, used for
|
|
270
|
+
streamlining authentication.
|
|
271
|
+
|
|
272
|
+
browser_type: The type of browser to use. Supported values include 'chromium', 'firefox', and
|
|
273
|
+
'webkit'.
|
|
274
|
+
|
|
275
|
+
headless: Whether to run the browser in headless mode.
|
|
276
|
+
|
|
277
|
+
raccoon_passcode: The raccoon passcode associated with the end user on behalf of which the call is
|
|
278
|
+
being made if any.
|
|
279
|
+
|
|
280
|
+
session_timeout: The timeout for the browser session in seconds.
|
|
281
|
+
|
|
282
|
+
settings: Configuration settings for the browser, such as viewport size and User-Agent
|
|
283
|
+
string.
|
|
284
|
+
|
|
285
|
+
url: The entrypoint url for the session.
|
|
286
|
+
|
|
287
|
+
extra_headers: Send extra headers
|
|
288
|
+
|
|
289
|
+
extra_query: Add additional query parameters to the request
|
|
290
|
+
|
|
291
|
+
extra_body: Add additional JSON properties to the request
|
|
292
|
+
|
|
293
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
294
|
+
"""
|
|
295
|
+
return await self._post(
|
|
296
|
+
"/sessions/create",
|
|
297
|
+
body=await async_maybe_transform(
|
|
298
|
+
{
|
|
299
|
+
"advanced": advanced,
|
|
300
|
+
"app_name": app_name,
|
|
301
|
+
"browser_type": browser_type,
|
|
302
|
+
"headless": headless,
|
|
303
|
+
"raccoon_passcode": raccoon_passcode,
|
|
304
|
+
"session_timeout": session_timeout,
|
|
305
|
+
"settings": settings,
|
|
306
|
+
"url": url,
|
|
307
|
+
},
|
|
308
|
+
fleet_create_params.FleetCreateParams,
|
|
309
|
+
),
|
|
310
|
+
options=make_request_options(
|
|
311
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
312
|
+
),
|
|
313
|
+
cast_to=FleetCreateResponse,
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
async def logs(
|
|
317
|
+
self,
|
|
318
|
+
session_id: str,
|
|
319
|
+
*,
|
|
320
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
321
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
322
|
+
extra_headers: Headers | None = None,
|
|
323
|
+
extra_query: Query | None = None,
|
|
324
|
+
extra_body: Body | None = None,
|
|
325
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
326
|
+
) -> FleetLogsResponse:
|
|
327
|
+
"""
|
|
328
|
+
Fleet Session Logs Endpoint
|
|
329
|
+
|
|
330
|
+
Args:
|
|
331
|
+
extra_headers: Send extra headers
|
|
332
|
+
|
|
333
|
+
extra_query: Add additional query parameters to the request
|
|
334
|
+
|
|
335
|
+
extra_body: Add additional JSON properties to the request
|
|
336
|
+
|
|
337
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
338
|
+
"""
|
|
339
|
+
if not session_id:
|
|
340
|
+
raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
|
|
341
|
+
return await self._get(
|
|
342
|
+
f"/sessions/{session_id}/logs",
|
|
343
|
+
options=make_request_options(
|
|
344
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
345
|
+
),
|
|
346
|
+
cast_to=FleetLogsResponse,
|
|
347
|
+
)
|
|
348
|
+
|
|
349
|
+
async def status(
|
|
350
|
+
self,
|
|
351
|
+
session_id: str,
|
|
352
|
+
*,
|
|
353
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
354
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
355
|
+
extra_headers: Headers | None = None,
|
|
356
|
+
extra_query: Query | None = None,
|
|
357
|
+
extra_body: Body | None = None,
|
|
358
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
359
|
+
) -> FleetStatusResponse:
|
|
360
|
+
"""
|
|
361
|
+
Fleet Session Status Endpoint
|
|
362
|
+
|
|
363
|
+
Args:
|
|
364
|
+
extra_headers: Send extra headers
|
|
365
|
+
|
|
366
|
+
extra_query: Add additional query parameters to the request
|
|
367
|
+
|
|
368
|
+
extra_body: Add additional JSON properties to the request
|
|
369
|
+
|
|
370
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
371
|
+
"""
|
|
372
|
+
if not session_id:
|
|
373
|
+
raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
|
|
374
|
+
return await self._get(
|
|
375
|
+
f"/sessions/{session_id}/status",
|
|
376
|
+
options=make_request_options(
|
|
377
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
378
|
+
),
|
|
379
|
+
cast_to=FleetStatusResponse,
|
|
380
|
+
)
|
|
381
|
+
|
|
382
|
+
async def terminate(
|
|
383
|
+
self,
|
|
384
|
+
session_id: str,
|
|
385
|
+
*,
|
|
386
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
387
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
388
|
+
extra_headers: Headers | None = None,
|
|
389
|
+
extra_query: Query | None = None,
|
|
390
|
+
extra_body: Body | None = None,
|
|
391
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
392
|
+
) -> FleetTerminateResponse:
|
|
393
|
+
"""
|
|
394
|
+
Fleet Session Terminate Endpoint
|
|
395
|
+
|
|
396
|
+
Args:
|
|
397
|
+
extra_headers: Send extra headers
|
|
398
|
+
|
|
399
|
+
extra_query: Add additional query parameters to the request
|
|
400
|
+
|
|
401
|
+
extra_body: Add additional JSON properties to the request
|
|
402
|
+
|
|
403
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
404
|
+
"""
|
|
405
|
+
if not session_id:
|
|
406
|
+
raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
|
|
407
|
+
return await self._delete(
|
|
408
|
+
f"/sessions/{session_id}/terminate",
|
|
409
|
+
options=make_request_options(
|
|
410
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
411
|
+
),
|
|
412
|
+
cast_to=FleetTerminateResponse,
|
|
413
|
+
)
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
class FleetResourceWithRawResponse:
|
|
417
|
+
def __init__(self, fleet: FleetResource) -> None:
|
|
418
|
+
self._fleet = fleet
|
|
419
|
+
|
|
420
|
+
self.create = to_raw_response_wrapper(
|
|
421
|
+
fleet.create,
|
|
422
|
+
)
|
|
423
|
+
self.logs = to_raw_response_wrapper(
|
|
424
|
+
fleet.logs,
|
|
425
|
+
)
|
|
426
|
+
self.status = to_raw_response_wrapper(
|
|
427
|
+
fleet.status,
|
|
428
|
+
)
|
|
429
|
+
self.terminate = to_raw_response_wrapper(
|
|
430
|
+
fleet.terminate,
|
|
431
|
+
)
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
class AsyncFleetResourceWithRawResponse:
|
|
435
|
+
def __init__(self, fleet: AsyncFleetResource) -> None:
|
|
436
|
+
self._fleet = fleet
|
|
437
|
+
|
|
438
|
+
self.create = async_to_raw_response_wrapper(
|
|
439
|
+
fleet.create,
|
|
440
|
+
)
|
|
441
|
+
self.logs = async_to_raw_response_wrapper(
|
|
442
|
+
fleet.logs,
|
|
443
|
+
)
|
|
444
|
+
self.status = async_to_raw_response_wrapper(
|
|
445
|
+
fleet.status,
|
|
446
|
+
)
|
|
447
|
+
self.terminate = async_to_raw_response_wrapper(
|
|
448
|
+
fleet.terminate,
|
|
449
|
+
)
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
class FleetResourceWithStreamingResponse:
|
|
453
|
+
def __init__(self, fleet: FleetResource) -> None:
|
|
454
|
+
self._fleet = fleet
|
|
455
|
+
|
|
456
|
+
self.create = to_streamed_response_wrapper(
|
|
457
|
+
fleet.create,
|
|
458
|
+
)
|
|
459
|
+
self.logs = to_streamed_response_wrapper(
|
|
460
|
+
fleet.logs,
|
|
461
|
+
)
|
|
462
|
+
self.status = to_streamed_response_wrapper(
|
|
463
|
+
fleet.status,
|
|
464
|
+
)
|
|
465
|
+
self.terminate = to_streamed_response_wrapper(
|
|
466
|
+
fleet.terminate,
|
|
467
|
+
)
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
class AsyncFleetResourceWithStreamingResponse:
|
|
471
|
+
def __init__(self, fleet: AsyncFleetResource) -> None:
|
|
472
|
+
self._fleet = fleet
|
|
473
|
+
|
|
474
|
+
self.create = async_to_streamed_response_wrapper(
|
|
475
|
+
fleet.create,
|
|
476
|
+
)
|
|
477
|
+
self.logs = async_to_streamed_response_wrapper(
|
|
478
|
+
fleet.logs,
|
|
479
|
+
)
|
|
480
|
+
self.status = async_to_streamed_response_wrapper(
|
|
481
|
+
fleet.status,
|
|
482
|
+
)
|
|
483
|
+
self.terminate = async_to_streamed_response_wrapper(
|
|
484
|
+
fleet.terminate,
|
|
485
|
+
)
|