raccoonai 0.1.0a7__py3-none-any.whl → 0.1.0a9__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/_base_client.py +1 -96
- raccoonai/_client.py +18 -1
- raccoonai/_files.py +1 -1
- raccoonai/_version.py +1 -1
- raccoonai/resources/__init__.py +28 -0
- raccoonai/resources/extensions.py +400 -0
- raccoonai/resources/fleet.py +173 -2
- raccoonai/resources/lam.py +151 -347
- raccoonai/resources/tail/__init__.py +47 -0
- raccoonai/resources/tail/apps.py +225 -0
- raccoonai/resources/tail/auth.py +186 -0
- raccoonai/resources/tail/tail.py +273 -0
- raccoonai/types/__init__.py +10 -2
- raccoonai/types/extension_all_response.py +22 -0
- raccoonai/types/extension_get_response.py +16 -0
- raccoonai/types/extension_upload_params.py +13 -0
- raccoonai/types/extension_upload_response.py +16 -0
- raccoonai/types/fleet_sessions_params.py +42 -0
- raccoonai/types/fleet_sessions_response.py +58 -0
- raccoonai/types/lam_tasks_params.py +39 -0
- raccoonai/types/lam_tasks_response.py +52 -0
- raccoonai/types/tail/__init__.py +9 -0
- raccoonai/types/tail/app_all_response.py +38 -0
- raccoonai/types/tail/app_linked_params.py +13 -0
- raccoonai/types/tail/app_linked_response.py +14 -0
- raccoonai/types/tail/auth_status_params.py +15 -0
- raccoonai/types/tail/auth_status_response.py +17 -0
- raccoonai/types/tail_users_params.py +26 -0
- raccoonai/types/tail_users_response.py +48 -0
- {raccoonai-0.1.0a7.dist-info → raccoonai-0.1.0a9.dist-info}/METADATA +18 -1
- raccoonai-0.1.0a9.dist-info/RECORD +61 -0
- raccoonai/types/lam_integration_run_params.py +0 -78
- raccoonai/types/lam_integration_run_response.py +0 -53
- raccoonai-0.1.0a7.dist-info/RECORD +0 -42
- {raccoonai-0.1.0a7.dist-info → raccoonai-0.1.0a9.dist-info}/WHEEL +0 -0
- {raccoonai-0.1.0a7.dist-info → raccoonai-0.1.0a9.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,400 @@
|
|
|
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 Mapping, cast
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ..types import extension_upload_params
|
|
10
|
+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
|
|
11
|
+
from .._utils import (
|
|
12
|
+
extract_files,
|
|
13
|
+
maybe_transform,
|
|
14
|
+
deepcopy_minimal,
|
|
15
|
+
async_maybe_transform,
|
|
16
|
+
)
|
|
17
|
+
from .._compat import cached_property
|
|
18
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
19
|
+
from .._response import (
|
|
20
|
+
to_raw_response_wrapper,
|
|
21
|
+
to_streamed_response_wrapper,
|
|
22
|
+
async_to_raw_response_wrapper,
|
|
23
|
+
async_to_streamed_response_wrapper,
|
|
24
|
+
)
|
|
25
|
+
from .._base_client import make_request_options
|
|
26
|
+
from ..types.extension_all_response import ExtensionAllResponse
|
|
27
|
+
from ..types.extension_get_response import ExtensionGetResponse
|
|
28
|
+
from ..types.extension_upload_response import ExtensionUploadResponse
|
|
29
|
+
|
|
30
|
+
__all__ = ["ExtensionsResource", "AsyncExtensionsResource"]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class ExtensionsResource(SyncAPIResource):
|
|
34
|
+
@cached_property
|
|
35
|
+
def with_raw_response(self) -> ExtensionsResourceWithRawResponse:
|
|
36
|
+
"""
|
|
37
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
38
|
+
the raw response object instead of the parsed content.
|
|
39
|
+
|
|
40
|
+
For more information, see https://www.github.com/raccoonaihq/raccoonai-python#accessing-raw-response-data-eg-headers
|
|
41
|
+
"""
|
|
42
|
+
return ExtensionsResourceWithRawResponse(self)
|
|
43
|
+
|
|
44
|
+
@cached_property
|
|
45
|
+
def with_streaming_response(self) -> ExtensionsResourceWithStreamingResponse:
|
|
46
|
+
"""
|
|
47
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
48
|
+
|
|
49
|
+
For more information, see https://www.github.com/raccoonaihq/raccoonai-python#with_streaming_response
|
|
50
|
+
"""
|
|
51
|
+
return ExtensionsResourceWithStreamingResponse(self)
|
|
52
|
+
|
|
53
|
+
def delete(
|
|
54
|
+
self,
|
|
55
|
+
extension_id: str,
|
|
56
|
+
*,
|
|
57
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
58
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
59
|
+
extra_headers: Headers | None = None,
|
|
60
|
+
extra_query: Query | None = None,
|
|
61
|
+
extra_body: Body | None = None,
|
|
62
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
63
|
+
) -> object:
|
|
64
|
+
"""
|
|
65
|
+
Delete Extension Endpoint
|
|
66
|
+
|
|
67
|
+
Args:
|
|
68
|
+
extension_id: The ID of the extension to delete
|
|
69
|
+
|
|
70
|
+
extra_headers: Send extra headers
|
|
71
|
+
|
|
72
|
+
extra_query: Add additional query parameters to the request
|
|
73
|
+
|
|
74
|
+
extra_body: Add additional JSON properties to the request
|
|
75
|
+
|
|
76
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
77
|
+
"""
|
|
78
|
+
if not extension_id:
|
|
79
|
+
raise ValueError(f"Expected a non-empty value for `extension_id` but received {extension_id!r}")
|
|
80
|
+
return self._delete(
|
|
81
|
+
f"/extensions/{extension_id}",
|
|
82
|
+
options=make_request_options(
|
|
83
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
84
|
+
),
|
|
85
|
+
cast_to=object,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
def all(
|
|
89
|
+
self,
|
|
90
|
+
*,
|
|
91
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
92
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
93
|
+
extra_headers: Headers | None = None,
|
|
94
|
+
extra_query: Query | None = None,
|
|
95
|
+
extra_body: Body | None = None,
|
|
96
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
97
|
+
) -> ExtensionAllResponse:
|
|
98
|
+
"""List Extensions Endpoint"""
|
|
99
|
+
return self._get(
|
|
100
|
+
"/extensions",
|
|
101
|
+
options=make_request_options(
|
|
102
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
103
|
+
),
|
|
104
|
+
cast_to=ExtensionAllResponse,
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
def get(
|
|
108
|
+
self,
|
|
109
|
+
extension_id: str,
|
|
110
|
+
*,
|
|
111
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
112
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
113
|
+
extra_headers: Headers | None = None,
|
|
114
|
+
extra_query: Query | None = None,
|
|
115
|
+
extra_body: Body | None = None,
|
|
116
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
117
|
+
) -> ExtensionGetResponse:
|
|
118
|
+
"""
|
|
119
|
+
Get Extension Endpoint
|
|
120
|
+
|
|
121
|
+
Args:
|
|
122
|
+
extension_id: The ID of the extension
|
|
123
|
+
|
|
124
|
+
extra_headers: Send extra headers
|
|
125
|
+
|
|
126
|
+
extra_query: Add additional query parameters to the request
|
|
127
|
+
|
|
128
|
+
extra_body: Add additional JSON properties to the request
|
|
129
|
+
|
|
130
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
131
|
+
"""
|
|
132
|
+
if not extension_id:
|
|
133
|
+
raise ValueError(f"Expected a non-empty value for `extension_id` but received {extension_id!r}")
|
|
134
|
+
return self._get(
|
|
135
|
+
f"/extensions/{extension_id}",
|
|
136
|
+
options=make_request_options(
|
|
137
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
138
|
+
),
|
|
139
|
+
cast_to=ExtensionGetResponse,
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
def upload(
|
|
143
|
+
self,
|
|
144
|
+
*,
|
|
145
|
+
file: FileTypes,
|
|
146
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
147
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
148
|
+
extra_headers: Headers | None = None,
|
|
149
|
+
extra_query: Query | None = None,
|
|
150
|
+
extra_body: Body | None = None,
|
|
151
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
152
|
+
) -> ExtensionUploadResponse:
|
|
153
|
+
"""
|
|
154
|
+
Upload Extension Endpoint
|
|
155
|
+
|
|
156
|
+
Args:
|
|
157
|
+
extra_headers: Send extra headers
|
|
158
|
+
|
|
159
|
+
extra_query: Add additional query parameters to the request
|
|
160
|
+
|
|
161
|
+
extra_body: Add additional JSON properties to the request
|
|
162
|
+
|
|
163
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
164
|
+
"""
|
|
165
|
+
body = deepcopy_minimal({"file": file})
|
|
166
|
+
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
|
167
|
+
# It should be noted that the actual Content-Type header that will be
|
|
168
|
+
# sent to the server will contain a `boundary` parameter, e.g.
|
|
169
|
+
# multipart/form-data; boundary=---abc--
|
|
170
|
+
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
|
171
|
+
return self._post(
|
|
172
|
+
"/extensions",
|
|
173
|
+
body=maybe_transform(body, extension_upload_params.ExtensionUploadParams),
|
|
174
|
+
files=files,
|
|
175
|
+
options=make_request_options(
|
|
176
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
177
|
+
),
|
|
178
|
+
cast_to=ExtensionUploadResponse,
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
class AsyncExtensionsResource(AsyncAPIResource):
|
|
183
|
+
@cached_property
|
|
184
|
+
def with_raw_response(self) -> AsyncExtensionsResourceWithRawResponse:
|
|
185
|
+
"""
|
|
186
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
187
|
+
the raw response object instead of the parsed content.
|
|
188
|
+
|
|
189
|
+
For more information, see https://www.github.com/raccoonaihq/raccoonai-python#accessing-raw-response-data-eg-headers
|
|
190
|
+
"""
|
|
191
|
+
return AsyncExtensionsResourceWithRawResponse(self)
|
|
192
|
+
|
|
193
|
+
@cached_property
|
|
194
|
+
def with_streaming_response(self) -> AsyncExtensionsResourceWithStreamingResponse:
|
|
195
|
+
"""
|
|
196
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
197
|
+
|
|
198
|
+
For more information, see https://www.github.com/raccoonaihq/raccoonai-python#with_streaming_response
|
|
199
|
+
"""
|
|
200
|
+
return AsyncExtensionsResourceWithStreamingResponse(self)
|
|
201
|
+
|
|
202
|
+
async def delete(
|
|
203
|
+
self,
|
|
204
|
+
extension_id: str,
|
|
205
|
+
*,
|
|
206
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
207
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
208
|
+
extra_headers: Headers | None = None,
|
|
209
|
+
extra_query: Query | None = None,
|
|
210
|
+
extra_body: Body | None = None,
|
|
211
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
212
|
+
) -> object:
|
|
213
|
+
"""
|
|
214
|
+
Delete Extension Endpoint
|
|
215
|
+
|
|
216
|
+
Args:
|
|
217
|
+
extension_id: The ID of the extension to delete
|
|
218
|
+
|
|
219
|
+
extra_headers: Send extra headers
|
|
220
|
+
|
|
221
|
+
extra_query: Add additional query parameters to the request
|
|
222
|
+
|
|
223
|
+
extra_body: Add additional JSON properties to the request
|
|
224
|
+
|
|
225
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
226
|
+
"""
|
|
227
|
+
if not extension_id:
|
|
228
|
+
raise ValueError(f"Expected a non-empty value for `extension_id` but received {extension_id!r}")
|
|
229
|
+
return await self._delete(
|
|
230
|
+
f"/extensions/{extension_id}",
|
|
231
|
+
options=make_request_options(
|
|
232
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
233
|
+
),
|
|
234
|
+
cast_to=object,
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
async def all(
|
|
238
|
+
self,
|
|
239
|
+
*,
|
|
240
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
241
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
242
|
+
extra_headers: Headers | None = None,
|
|
243
|
+
extra_query: Query | None = None,
|
|
244
|
+
extra_body: Body | None = None,
|
|
245
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
246
|
+
) -> ExtensionAllResponse:
|
|
247
|
+
"""List Extensions Endpoint"""
|
|
248
|
+
return await self._get(
|
|
249
|
+
"/extensions",
|
|
250
|
+
options=make_request_options(
|
|
251
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
252
|
+
),
|
|
253
|
+
cast_to=ExtensionAllResponse,
|
|
254
|
+
)
|
|
255
|
+
|
|
256
|
+
async def get(
|
|
257
|
+
self,
|
|
258
|
+
extension_id: str,
|
|
259
|
+
*,
|
|
260
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
261
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
262
|
+
extra_headers: Headers | None = None,
|
|
263
|
+
extra_query: Query | None = None,
|
|
264
|
+
extra_body: Body | None = None,
|
|
265
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
266
|
+
) -> ExtensionGetResponse:
|
|
267
|
+
"""
|
|
268
|
+
Get Extension Endpoint
|
|
269
|
+
|
|
270
|
+
Args:
|
|
271
|
+
extension_id: The ID of the extension
|
|
272
|
+
|
|
273
|
+
extra_headers: Send extra headers
|
|
274
|
+
|
|
275
|
+
extra_query: Add additional query parameters to the request
|
|
276
|
+
|
|
277
|
+
extra_body: Add additional JSON properties to the request
|
|
278
|
+
|
|
279
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
280
|
+
"""
|
|
281
|
+
if not extension_id:
|
|
282
|
+
raise ValueError(f"Expected a non-empty value for `extension_id` but received {extension_id!r}")
|
|
283
|
+
return await self._get(
|
|
284
|
+
f"/extensions/{extension_id}",
|
|
285
|
+
options=make_request_options(
|
|
286
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
287
|
+
),
|
|
288
|
+
cast_to=ExtensionGetResponse,
|
|
289
|
+
)
|
|
290
|
+
|
|
291
|
+
async def upload(
|
|
292
|
+
self,
|
|
293
|
+
*,
|
|
294
|
+
file: FileTypes,
|
|
295
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
296
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
297
|
+
extra_headers: Headers | None = None,
|
|
298
|
+
extra_query: Query | None = None,
|
|
299
|
+
extra_body: Body | None = None,
|
|
300
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
301
|
+
) -> ExtensionUploadResponse:
|
|
302
|
+
"""
|
|
303
|
+
Upload Extension Endpoint
|
|
304
|
+
|
|
305
|
+
Args:
|
|
306
|
+
extra_headers: Send extra headers
|
|
307
|
+
|
|
308
|
+
extra_query: Add additional query parameters to the request
|
|
309
|
+
|
|
310
|
+
extra_body: Add additional JSON properties to the request
|
|
311
|
+
|
|
312
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
313
|
+
"""
|
|
314
|
+
body = deepcopy_minimal({"file": file})
|
|
315
|
+
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
|
|
316
|
+
# It should be noted that the actual Content-Type header that will be
|
|
317
|
+
# sent to the server will contain a `boundary` parameter, e.g.
|
|
318
|
+
# multipart/form-data; boundary=---abc--
|
|
319
|
+
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
|
|
320
|
+
return await self._post(
|
|
321
|
+
"/extensions",
|
|
322
|
+
body=await async_maybe_transform(body, extension_upload_params.ExtensionUploadParams),
|
|
323
|
+
files=files,
|
|
324
|
+
options=make_request_options(
|
|
325
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
326
|
+
),
|
|
327
|
+
cast_to=ExtensionUploadResponse,
|
|
328
|
+
)
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
class ExtensionsResourceWithRawResponse:
|
|
332
|
+
def __init__(self, extensions: ExtensionsResource) -> None:
|
|
333
|
+
self._extensions = extensions
|
|
334
|
+
|
|
335
|
+
self.delete = to_raw_response_wrapper(
|
|
336
|
+
extensions.delete,
|
|
337
|
+
)
|
|
338
|
+
self.all = to_raw_response_wrapper(
|
|
339
|
+
extensions.all,
|
|
340
|
+
)
|
|
341
|
+
self.get = to_raw_response_wrapper(
|
|
342
|
+
extensions.get,
|
|
343
|
+
)
|
|
344
|
+
self.upload = to_raw_response_wrapper(
|
|
345
|
+
extensions.upload,
|
|
346
|
+
)
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
class AsyncExtensionsResourceWithRawResponse:
|
|
350
|
+
def __init__(self, extensions: AsyncExtensionsResource) -> None:
|
|
351
|
+
self._extensions = extensions
|
|
352
|
+
|
|
353
|
+
self.delete = async_to_raw_response_wrapper(
|
|
354
|
+
extensions.delete,
|
|
355
|
+
)
|
|
356
|
+
self.all = async_to_raw_response_wrapper(
|
|
357
|
+
extensions.all,
|
|
358
|
+
)
|
|
359
|
+
self.get = async_to_raw_response_wrapper(
|
|
360
|
+
extensions.get,
|
|
361
|
+
)
|
|
362
|
+
self.upload = async_to_raw_response_wrapper(
|
|
363
|
+
extensions.upload,
|
|
364
|
+
)
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
class ExtensionsResourceWithStreamingResponse:
|
|
368
|
+
def __init__(self, extensions: ExtensionsResource) -> None:
|
|
369
|
+
self._extensions = extensions
|
|
370
|
+
|
|
371
|
+
self.delete = to_streamed_response_wrapper(
|
|
372
|
+
extensions.delete,
|
|
373
|
+
)
|
|
374
|
+
self.all = to_streamed_response_wrapper(
|
|
375
|
+
extensions.all,
|
|
376
|
+
)
|
|
377
|
+
self.get = to_streamed_response_wrapper(
|
|
378
|
+
extensions.get,
|
|
379
|
+
)
|
|
380
|
+
self.upload = to_streamed_response_wrapper(
|
|
381
|
+
extensions.upload,
|
|
382
|
+
)
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
class AsyncExtensionsResourceWithStreamingResponse:
|
|
386
|
+
def __init__(self, extensions: AsyncExtensionsResource) -> None:
|
|
387
|
+
self._extensions = extensions
|
|
388
|
+
|
|
389
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
390
|
+
extensions.delete,
|
|
391
|
+
)
|
|
392
|
+
self.all = async_to_streamed_response_wrapper(
|
|
393
|
+
extensions.all,
|
|
394
|
+
)
|
|
395
|
+
self.get = async_to_streamed_response_wrapper(
|
|
396
|
+
extensions.get,
|
|
397
|
+
)
|
|
398
|
+
self.upload = async_to_streamed_response_wrapper(
|
|
399
|
+
extensions.upload,
|
|
400
|
+
)
|
raccoonai/resources/fleet.py
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Optional
|
|
5
|
+
from typing import List, Optional
|
|
6
6
|
from typing_extensions import Literal
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
9
9
|
|
|
10
|
-
from ..types import fleet_create_params
|
|
10
|
+
from ..types import fleet_create_params, fleet_sessions_params
|
|
11
11
|
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
12
12
|
from .._utils import (
|
|
13
13
|
maybe_transform,
|
|
@@ -25,6 +25,7 @@ from .._base_client import make_request_options
|
|
|
25
25
|
from ..types.fleet_logs_response import FleetLogsResponse
|
|
26
26
|
from ..types.fleet_create_response import FleetCreateResponse
|
|
27
27
|
from ..types.fleet_status_response import FleetStatusResponse
|
|
28
|
+
from ..types.fleet_sessions_response import FleetSessionsResponse
|
|
28
29
|
from ..types.fleet_terminate_response import FleetTerminateResponse
|
|
29
30
|
|
|
30
31
|
__all__ = ["FleetResource", "AsyncFleetResource"]
|
|
@@ -150,6 +151,85 @@ class FleetResource(SyncAPIResource):
|
|
|
150
151
|
cast_to=FleetLogsResponse,
|
|
151
152
|
)
|
|
152
153
|
|
|
154
|
+
def sessions(
|
|
155
|
+
self,
|
|
156
|
+
*,
|
|
157
|
+
end_time: Optional[int] | NotGiven = NOT_GIVEN,
|
|
158
|
+
execution_type: Optional[List[Literal["run", "extract", "fleet"]]] | NotGiven = NOT_GIVEN,
|
|
159
|
+
limit: Optional[int] | NotGiven = NOT_GIVEN,
|
|
160
|
+
page: Optional[int] | NotGiven = NOT_GIVEN,
|
|
161
|
+
raccoon_passcode: Optional[str] | NotGiven = NOT_GIVEN,
|
|
162
|
+
session_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
163
|
+
sort_by: Optional[Literal["timestamp", "executionTime", "taskId", "status", "executionType"]]
|
|
164
|
+
| NotGiven = NOT_GIVEN,
|
|
165
|
+
sort_order: Optional[Literal["ascend", "descend"]] | NotGiven = NOT_GIVEN,
|
|
166
|
+
start_time: Optional[int] | NotGiven = NOT_GIVEN,
|
|
167
|
+
task_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
168
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
169
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
170
|
+
extra_headers: Headers | None = None,
|
|
171
|
+
extra_query: Query | None = None,
|
|
172
|
+
extra_body: Body | None = None,
|
|
173
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
174
|
+
) -> FleetSessionsResponse:
|
|
175
|
+
"""
|
|
176
|
+
Get Sessions Endpoint
|
|
177
|
+
|
|
178
|
+
Args:
|
|
179
|
+
end_time: Filter sessions created before this Unix timestamp (in milliseconds).
|
|
180
|
+
|
|
181
|
+
execution_type: Filter sessions by execution type (e.g., 'run', 'extract').
|
|
182
|
+
|
|
183
|
+
limit: Number of sessions per page (maximum 100).
|
|
184
|
+
|
|
185
|
+
page: Page number for pagination.
|
|
186
|
+
|
|
187
|
+
raccoon_passcode: Filter sessions by Raccoon passcode.
|
|
188
|
+
|
|
189
|
+
session_id: Filter sessions by a specific session ID.
|
|
190
|
+
|
|
191
|
+
sort_by: Field to sort sessions by (e.g., 'timestamp', 'executionTime').
|
|
192
|
+
|
|
193
|
+
sort_order: Sort order ('ascend' or 'descend').
|
|
194
|
+
|
|
195
|
+
start_time: Filter sessions created after this Unix timestamp (in milliseconds).
|
|
196
|
+
|
|
197
|
+
task_id: Filter sessions by a specific task ID.
|
|
198
|
+
|
|
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
|
+
return self._get(
|
|
208
|
+
"/sessions",
|
|
209
|
+
options=make_request_options(
|
|
210
|
+
extra_headers=extra_headers,
|
|
211
|
+
extra_query=extra_query,
|
|
212
|
+
extra_body=extra_body,
|
|
213
|
+
timeout=timeout,
|
|
214
|
+
query=maybe_transform(
|
|
215
|
+
{
|
|
216
|
+
"end_time": end_time,
|
|
217
|
+
"execution_type": execution_type,
|
|
218
|
+
"limit": limit,
|
|
219
|
+
"page": page,
|
|
220
|
+
"raccoon_passcode": raccoon_passcode,
|
|
221
|
+
"session_id": session_id,
|
|
222
|
+
"sort_by": sort_by,
|
|
223
|
+
"sort_order": sort_order,
|
|
224
|
+
"start_time": start_time,
|
|
225
|
+
"task_id": task_id,
|
|
226
|
+
},
|
|
227
|
+
fleet_sessions_params.FleetSessionsParams,
|
|
228
|
+
),
|
|
229
|
+
),
|
|
230
|
+
cast_to=FleetSessionsResponse,
|
|
231
|
+
)
|
|
232
|
+
|
|
153
233
|
def status(
|
|
154
234
|
self,
|
|
155
235
|
session_id: str,
|
|
@@ -337,6 +417,85 @@ class AsyncFleetResource(AsyncAPIResource):
|
|
|
337
417
|
cast_to=FleetLogsResponse,
|
|
338
418
|
)
|
|
339
419
|
|
|
420
|
+
async def sessions(
|
|
421
|
+
self,
|
|
422
|
+
*,
|
|
423
|
+
end_time: Optional[int] | NotGiven = NOT_GIVEN,
|
|
424
|
+
execution_type: Optional[List[Literal["run", "extract", "fleet"]]] | NotGiven = NOT_GIVEN,
|
|
425
|
+
limit: Optional[int] | NotGiven = NOT_GIVEN,
|
|
426
|
+
page: Optional[int] | NotGiven = NOT_GIVEN,
|
|
427
|
+
raccoon_passcode: Optional[str] | NotGiven = NOT_GIVEN,
|
|
428
|
+
session_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
429
|
+
sort_by: Optional[Literal["timestamp", "executionTime", "taskId", "status", "executionType"]]
|
|
430
|
+
| NotGiven = NOT_GIVEN,
|
|
431
|
+
sort_order: Optional[Literal["ascend", "descend"]] | NotGiven = NOT_GIVEN,
|
|
432
|
+
start_time: Optional[int] | NotGiven = NOT_GIVEN,
|
|
433
|
+
task_id: Optional[str] | NotGiven = NOT_GIVEN,
|
|
434
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
435
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
436
|
+
extra_headers: Headers | None = None,
|
|
437
|
+
extra_query: Query | None = None,
|
|
438
|
+
extra_body: Body | None = None,
|
|
439
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
440
|
+
) -> FleetSessionsResponse:
|
|
441
|
+
"""
|
|
442
|
+
Get Sessions Endpoint
|
|
443
|
+
|
|
444
|
+
Args:
|
|
445
|
+
end_time: Filter sessions created before this Unix timestamp (in milliseconds).
|
|
446
|
+
|
|
447
|
+
execution_type: Filter sessions by execution type (e.g., 'run', 'extract').
|
|
448
|
+
|
|
449
|
+
limit: Number of sessions per page (maximum 100).
|
|
450
|
+
|
|
451
|
+
page: Page number for pagination.
|
|
452
|
+
|
|
453
|
+
raccoon_passcode: Filter sessions by Raccoon passcode.
|
|
454
|
+
|
|
455
|
+
session_id: Filter sessions by a specific session ID.
|
|
456
|
+
|
|
457
|
+
sort_by: Field to sort sessions by (e.g., 'timestamp', 'executionTime').
|
|
458
|
+
|
|
459
|
+
sort_order: Sort order ('ascend' or 'descend').
|
|
460
|
+
|
|
461
|
+
start_time: Filter sessions created after this Unix timestamp (in milliseconds).
|
|
462
|
+
|
|
463
|
+
task_id: Filter sessions by a specific task ID.
|
|
464
|
+
|
|
465
|
+
extra_headers: Send extra headers
|
|
466
|
+
|
|
467
|
+
extra_query: Add additional query parameters to the request
|
|
468
|
+
|
|
469
|
+
extra_body: Add additional JSON properties to the request
|
|
470
|
+
|
|
471
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
472
|
+
"""
|
|
473
|
+
return await self._get(
|
|
474
|
+
"/sessions",
|
|
475
|
+
options=make_request_options(
|
|
476
|
+
extra_headers=extra_headers,
|
|
477
|
+
extra_query=extra_query,
|
|
478
|
+
extra_body=extra_body,
|
|
479
|
+
timeout=timeout,
|
|
480
|
+
query=await async_maybe_transform(
|
|
481
|
+
{
|
|
482
|
+
"end_time": end_time,
|
|
483
|
+
"execution_type": execution_type,
|
|
484
|
+
"limit": limit,
|
|
485
|
+
"page": page,
|
|
486
|
+
"raccoon_passcode": raccoon_passcode,
|
|
487
|
+
"session_id": session_id,
|
|
488
|
+
"sort_by": sort_by,
|
|
489
|
+
"sort_order": sort_order,
|
|
490
|
+
"start_time": start_time,
|
|
491
|
+
"task_id": task_id,
|
|
492
|
+
},
|
|
493
|
+
fleet_sessions_params.FleetSessionsParams,
|
|
494
|
+
),
|
|
495
|
+
),
|
|
496
|
+
cast_to=FleetSessionsResponse,
|
|
497
|
+
)
|
|
498
|
+
|
|
340
499
|
async def status(
|
|
341
500
|
self,
|
|
342
501
|
session_id: str,
|
|
@@ -414,6 +573,9 @@ class FleetResourceWithRawResponse:
|
|
|
414
573
|
self.logs = to_raw_response_wrapper(
|
|
415
574
|
fleet.logs,
|
|
416
575
|
)
|
|
576
|
+
self.sessions = to_raw_response_wrapper(
|
|
577
|
+
fleet.sessions,
|
|
578
|
+
)
|
|
417
579
|
self.status = to_raw_response_wrapper(
|
|
418
580
|
fleet.status,
|
|
419
581
|
)
|
|
@@ -432,6 +594,9 @@ class AsyncFleetResourceWithRawResponse:
|
|
|
432
594
|
self.logs = async_to_raw_response_wrapper(
|
|
433
595
|
fleet.logs,
|
|
434
596
|
)
|
|
597
|
+
self.sessions = async_to_raw_response_wrapper(
|
|
598
|
+
fleet.sessions,
|
|
599
|
+
)
|
|
435
600
|
self.status = async_to_raw_response_wrapper(
|
|
436
601
|
fleet.status,
|
|
437
602
|
)
|
|
@@ -450,6 +615,9 @@ class FleetResourceWithStreamingResponse:
|
|
|
450
615
|
self.logs = to_streamed_response_wrapper(
|
|
451
616
|
fleet.logs,
|
|
452
617
|
)
|
|
618
|
+
self.sessions = to_streamed_response_wrapper(
|
|
619
|
+
fleet.sessions,
|
|
620
|
+
)
|
|
453
621
|
self.status = to_streamed_response_wrapper(
|
|
454
622
|
fleet.status,
|
|
455
623
|
)
|
|
@@ -468,6 +636,9 @@ class AsyncFleetResourceWithStreamingResponse:
|
|
|
468
636
|
self.logs = async_to_streamed_response_wrapper(
|
|
469
637
|
fleet.logs,
|
|
470
638
|
)
|
|
639
|
+
self.sessions = async_to_streamed_response_wrapper(
|
|
640
|
+
fleet.sessions,
|
|
641
|
+
)
|
|
471
642
|
self.status = async_to_streamed_response_wrapper(
|
|
472
643
|
fleet.status,
|
|
473
644
|
)
|