runloop-api-client 0.1.0a3__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.
Files changed (61) hide show
  1. runloop_api_client-0.1.0a3.dist-info/METADATA +334 -0
  2. runloop_api_client-0.1.0a3.dist-info/RECORD +61 -0
  3. runloop_api_client-0.1.0a3.dist-info/WHEEL +4 -0
  4. runloop_api_client-0.1.0a3.dist-info/licenses/LICENSE +7 -0
  5. runloop_minus_api_minus_client/__init__.py +83 -0
  6. runloop_minus_api_minus_client/_base_client.py +2006 -0
  7. runloop_minus_api_minus_client/_client.py +422 -0
  8. runloop_minus_api_minus_client/_compat.py +222 -0
  9. runloop_minus_api_minus_client/_constants.py +14 -0
  10. runloop_minus_api_minus_client/_exceptions.py +108 -0
  11. runloop_minus_api_minus_client/_files.py +127 -0
  12. runloop_minus_api_minus_client/_models.py +739 -0
  13. runloop_minus_api_minus_client/_qs.py +150 -0
  14. runloop_minus_api_minus_client/_resource.py +43 -0
  15. runloop_minus_api_minus_client/_response.py +822 -0
  16. runloop_minus_api_minus_client/_streaming.py +333 -0
  17. runloop_minus_api_minus_client/_types.py +220 -0
  18. runloop_minus_api_minus_client/_utils/__init__.py +52 -0
  19. runloop_minus_api_minus_client/_utils/_logs.py +25 -0
  20. runloop_minus_api_minus_client/_utils/_proxy.py +63 -0
  21. runloop_minus_api_minus_client/_utils/_reflection.py +8 -0
  22. runloop_minus_api_minus_client/_utils/_streams.py +12 -0
  23. runloop_minus_api_minus_client/_utils/_sync.py +81 -0
  24. runloop_minus_api_minus_client/_utils/_transform.py +382 -0
  25. runloop_minus_api_minus_client/_utils/_typing.py +120 -0
  26. runloop_minus_api_minus_client/_utils/_utils.py +402 -0
  27. runloop_minus_api_minus_client/_version.py +4 -0
  28. runloop_minus_api_minus_client/lib/.keep +4 -0
  29. runloop_minus_api_minus_client/py.typed +0 -0
  30. runloop_minus_api_minus_client/resources/__init__.py +47 -0
  31. runloop_minus_api_minus_client/resources/devboxes/__init__.py +33 -0
  32. runloop_minus_api_minus_client/resources/devboxes/devboxes.py +560 -0
  33. runloop_minus_api_minus_client/resources/devboxes/logs.py +143 -0
  34. runloop_minus_api_minus_client/resources/functions/__init__.py +33 -0
  35. runloop_minus_api_minus_client/resources/functions/functions.py +376 -0
  36. runloop_minus_api_minus_client/resources/functions/invocations/__init__.py +33 -0
  37. runloop_minus_api_minus_client/resources/functions/invocations/invocations.py +310 -0
  38. runloop_minus_api_minus_client/resources/functions/invocations/spans.py +147 -0
  39. runloop_minus_api_minus_client/resources/projects/__init__.py +33 -0
  40. runloop_minus_api_minus_client/resources/projects/logs.py +143 -0
  41. runloop_minus_api_minus_client/resources/projects/projects.py +155 -0
  42. runloop_minus_api_minus_client/types/__init__.py +14 -0
  43. runloop_minus_api_minus_client/types/devbox_create_params.py +30 -0
  44. runloop_minus_api_minus_client/types/devbox_execution_detail_view.py +21 -0
  45. runloop_minus_api_minus_client/types/devbox_list_params.py +12 -0
  46. runloop_minus_api_minus_client/types/devbox_list_view.py +13 -0
  47. runloop_minus_api_minus_client/types/devbox_view.py +21 -0
  48. runloop_minus_api_minus_client/types/devboxes/__init__.py +5 -0
  49. runloop_minus_api_minus_client/types/devboxes/devbox_logs_list_view.py +23 -0
  50. runloop_minus_api_minus_client/types/function_invoke_async_params.py +23 -0
  51. runloop_minus_api_minus_client/types/function_invoke_sync_params.py +23 -0
  52. runloop_minus_api_minus_client/types/function_list_view.py +20 -0
  53. runloop_minus_api_minus_client/types/functions/__init__.py +5 -0
  54. runloop_minus_api_minus_client/types/functions/function_invocation_list_view.py +26 -0
  55. runloop_minus_api_minus_client/types/functions/invocations/__init__.py +5 -0
  56. runloop_minus_api_minus_client/types/functions/invocations/invocation_span_list_view.py +16 -0
  57. runloop_minus_api_minus_client/types/project_list_view.py +149 -0
  58. runloop_minus_api_minus_client/types/projects/__init__.py +3 -0
  59. runloop_minus_api_minus_client/types/shared/__init__.py +4 -0
  60. runloop_minus_api_minus_client/types/shared/function_invocation_detail_view.py +25 -0
  61. runloop_minus_api_minus_client/types/shared/project_logs_view.py +22 -0
@@ -0,0 +1,310 @@
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 .spans import (
8
+ SpansResource,
9
+ AsyncSpansResource,
10
+ SpansResourceWithRawResponse,
11
+ AsyncSpansResourceWithRawResponse,
12
+ SpansResourceWithStreamingResponse,
13
+ AsyncSpansResourceWithStreamingResponse,
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 (
25
+ make_request_options,
26
+ )
27
+ from ....types.shared.function_invocation_detail_view import FunctionInvocationDetailView
28
+ from ....types.functions.function_invocation_list_view import FunctionInvocationListView
29
+
30
+ __all__ = ["InvocationsResource", "AsyncInvocationsResource"]
31
+
32
+
33
+ class InvocationsResource(SyncAPIResource):
34
+ @cached_property
35
+ def spans(self) -> SpansResource:
36
+ return SpansResource(self._client)
37
+
38
+ @cached_property
39
+ def with_raw_response(self) -> InvocationsResourceWithRawResponse:
40
+ return InvocationsResourceWithRawResponse(self)
41
+
42
+ @cached_property
43
+ def with_streaming_response(self) -> InvocationsResourceWithStreamingResponse:
44
+ return InvocationsResourceWithStreamingResponse(self)
45
+
46
+ def retrieve(
47
+ self,
48
+ invocation_id: str,
49
+ *,
50
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
51
+ # The extra values given here take precedence over values defined on the client or passed to this method.
52
+ extra_headers: Headers | None = None,
53
+ extra_query: Query | None = None,
54
+ extra_body: Body | None = None,
55
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
56
+ ) -> FunctionInvocationDetailView:
57
+ """Get the details of a function invocation.
58
+
59
+ This includes the status, response,
60
+ and error message.
61
+
62
+ Args:
63
+ extra_headers: Send extra headers
64
+
65
+ extra_query: Add additional query parameters to the request
66
+
67
+ extra_body: Add additional JSON properties to the request
68
+
69
+ timeout: Override the client-level default timeout for this request, in seconds
70
+ """
71
+ if not invocation_id:
72
+ raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}")
73
+ return self._get(
74
+ f"/v1/functions/invocations/{invocation_id}",
75
+ options=make_request_options(
76
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
77
+ ),
78
+ cast_to=FunctionInvocationDetailView,
79
+ )
80
+
81
+ def list(
82
+ self,
83
+ *,
84
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
85
+ # The extra values given here take precedence over values defined on the client or passed to this method.
86
+ extra_headers: Headers | None = None,
87
+ extra_query: Query | None = None,
88
+ extra_body: Body | None = None,
89
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
90
+ ) -> FunctionInvocationListView:
91
+ """List the functions invocations that are available for invocation."""
92
+ return self._get(
93
+ "/v1/functions/invocations",
94
+ options=make_request_options(
95
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
96
+ ),
97
+ cast_to=FunctionInvocationListView,
98
+ )
99
+
100
+ def kill(
101
+ self,
102
+ invocation_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
+ ) -> object:
111
+ """Kill the invocation with the given ID.
112
+
113
+ This will stop the function execution.
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 invocation_id:
125
+ raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}")
126
+ return self._post(
127
+ f"/v1/functions/invocations/{invocation_id}/kill",
128
+ options=make_request_options(
129
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
130
+ ),
131
+ cast_to=object,
132
+ )
133
+
134
+
135
+ class AsyncInvocationsResource(AsyncAPIResource):
136
+ @cached_property
137
+ def spans(self) -> AsyncSpansResource:
138
+ return AsyncSpansResource(self._client)
139
+
140
+ @cached_property
141
+ def with_raw_response(self) -> AsyncInvocationsResourceWithRawResponse:
142
+ return AsyncInvocationsResourceWithRawResponse(self)
143
+
144
+ @cached_property
145
+ def with_streaming_response(self) -> AsyncInvocationsResourceWithStreamingResponse:
146
+ return AsyncInvocationsResourceWithStreamingResponse(self)
147
+
148
+ async def retrieve(
149
+ self,
150
+ invocation_id: str,
151
+ *,
152
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
153
+ # The extra values given here take precedence over values defined on the client or passed to this method.
154
+ extra_headers: Headers | None = None,
155
+ extra_query: Query | None = None,
156
+ extra_body: Body | None = None,
157
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
158
+ ) -> FunctionInvocationDetailView:
159
+ """Get the details of a function invocation.
160
+
161
+ This includes the status, response,
162
+ and error message.
163
+
164
+ Args:
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 invocation_id:
174
+ raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}")
175
+ return await self._get(
176
+ f"/v1/functions/invocations/{invocation_id}",
177
+ options=make_request_options(
178
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
179
+ ),
180
+ cast_to=FunctionInvocationDetailView,
181
+ )
182
+
183
+ async def list(
184
+ self,
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
+ ) -> FunctionInvocationListView:
193
+ """List the functions invocations that are available for invocation."""
194
+ return await self._get(
195
+ "/v1/functions/invocations",
196
+ options=make_request_options(
197
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
198
+ ),
199
+ cast_to=FunctionInvocationListView,
200
+ )
201
+
202
+ async def kill(
203
+ self,
204
+ invocation_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
+ """Kill the invocation with the given ID.
214
+
215
+ This will stop the function execution.
216
+
217
+ Args:
218
+ extra_headers: Send extra headers
219
+
220
+ extra_query: Add additional query parameters to the request
221
+
222
+ extra_body: Add additional JSON properties to the request
223
+
224
+ timeout: Override the client-level default timeout for this request, in seconds
225
+ """
226
+ if not invocation_id:
227
+ raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}")
228
+ return await self._post(
229
+ f"/v1/functions/invocations/{invocation_id}/kill",
230
+ options=make_request_options(
231
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
232
+ ),
233
+ cast_to=object,
234
+ )
235
+
236
+
237
+ class InvocationsResourceWithRawResponse:
238
+ def __init__(self, invocations: InvocationsResource) -> None:
239
+ self._invocations = invocations
240
+
241
+ self.retrieve = to_raw_response_wrapper(
242
+ invocations.retrieve,
243
+ )
244
+ self.list = to_raw_response_wrapper(
245
+ invocations.list,
246
+ )
247
+ self.kill = to_raw_response_wrapper(
248
+ invocations.kill,
249
+ )
250
+
251
+ @cached_property
252
+ def spans(self) -> SpansResourceWithRawResponse:
253
+ return SpansResourceWithRawResponse(self._invocations.spans)
254
+
255
+
256
+ class AsyncInvocationsResourceWithRawResponse:
257
+ def __init__(self, invocations: AsyncInvocationsResource) -> None:
258
+ self._invocations = invocations
259
+
260
+ self.retrieve = async_to_raw_response_wrapper(
261
+ invocations.retrieve,
262
+ )
263
+ self.list = async_to_raw_response_wrapper(
264
+ invocations.list,
265
+ )
266
+ self.kill = async_to_raw_response_wrapper(
267
+ invocations.kill,
268
+ )
269
+
270
+ @cached_property
271
+ def spans(self) -> AsyncSpansResourceWithRawResponse:
272
+ return AsyncSpansResourceWithRawResponse(self._invocations.spans)
273
+
274
+
275
+ class InvocationsResourceWithStreamingResponse:
276
+ def __init__(self, invocations: InvocationsResource) -> None:
277
+ self._invocations = invocations
278
+
279
+ self.retrieve = to_streamed_response_wrapper(
280
+ invocations.retrieve,
281
+ )
282
+ self.list = to_streamed_response_wrapper(
283
+ invocations.list,
284
+ )
285
+ self.kill = to_streamed_response_wrapper(
286
+ invocations.kill,
287
+ )
288
+
289
+ @cached_property
290
+ def spans(self) -> SpansResourceWithStreamingResponse:
291
+ return SpansResourceWithStreamingResponse(self._invocations.spans)
292
+
293
+
294
+ class AsyncInvocationsResourceWithStreamingResponse:
295
+ def __init__(self, invocations: AsyncInvocationsResource) -> None:
296
+ self._invocations = invocations
297
+
298
+ self.retrieve = async_to_streamed_response_wrapper(
299
+ invocations.retrieve,
300
+ )
301
+ self.list = async_to_streamed_response_wrapper(
302
+ invocations.list,
303
+ )
304
+ self.kill = async_to_streamed_response_wrapper(
305
+ invocations.kill,
306
+ )
307
+
308
+ @cached_property
309
+ def spans(self) -> AsyncSpansResourceWithStreamingResponse:
310
+ return AsyncSpansResourceWithStreamingResponse(self._invocations.spans)
@@ -0,0 +1,147 @@
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
+ to_raw_response_wrapper,
12
+ to_streamed_response_wrapper,
13
+ async_to_raw_response_wrapper,
14
+ async_to_streamed_response_wrapper,
15
+ )
16
+ from ...._base_client import (
17
+ make_request_options,
18
+ )
19
+ from ....types.functions.invocations.invocation_span_list_view import InvocationSpanListView
20
+
21
+ __all__ = ["SpansResource", "AsyncSpansResource"]
22
+
23
+
24
+ class SpansResource(SyncAPIResource):
25
+ @cached_property
26
+ def with_raw_response(self) -> SpansResourceWithRawResponse:
27
+ return SpansResourceWithRawResponse(self)
28
+
29
+ @cached_property
30
+ def with_streaming_response(self) -> SpansResourceWithStreamingResponse:
31
+ return SpansResourceWithStreamingResponse(self)
32
+
33
+ def list(
34
+ self,
35
+ invocation_id: str,
36
+ *,
37
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
38
+ # The extra values given here take precedence over values defined on the client or passed to this method.
39
+ extra_headers: Headers | None = None,
40
+ extra_query: Query | None = None,
41
+ extra_body: Body | None = None,
42
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
43
+ ) -> InvocationSpanListView:
44
+ """Get the span points for the given invocation.
45
+
46
+ This will return the span points
47
+ for the invocation.
48
+
49
+ Args:
50
+ extra_headers: Send extra headers
51
+
52
+ extra_query: Add additional query parameters to the request
53
+
54
+ extra_body: Add additional JSON properties to the request
55
+
56
+ timeout: Override the client-level default timeout for this request, in seconds
57
+ """
58
+ if not invocation_id:
59
+ raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}")
60
+ return self._get(
61
+ f"/v1/functions/invocations/{invocation_id}/spans",
62
+ options=make_request_options(
63
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
64
+ ),
65
+ cast_to=InvocationSpanListView,
66
+ )
67
+
68
+
69
+ class AsyncSpansResource(AsyncAPIResource):
70
+ @cached_property
71
+ def with_raw_response(self) -> AsyncSpansResourceWithRawResponse:
72
+ return AsyncSpansResourceWithRawResponse(self)
73
+
74
+ @cached_property
75
+ def with_streaming_response(self) -> AsyncSpansResourceWithStreamingResponse:
76
+ return AsyncSpansResourceWithStreamingResponse(self)
77
+
78
+ async def list(
79
+ self,
80
+ invocation_id: str,
81
+ *,
82
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
83
+ # The extra values given here take precedence over values defined on the client or passed to this method.
84
+ extra_headers: Headers | None = None,
85
+ extra_query: Query | None = None,
86
+ extra_body: Body | None = None,
87
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
88
+ ) -> InvocationSpanListView:
89
+ """Get the span points for the given invocation.
90
+
91
+ This will return the span points
92
+ for the invocation.
93
+
94
+ Args:
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
+ if not invocation_id:
104
+ raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}")
105
+ return await self._get(
106
+ f"/v1/functions/invocations/{invocation_id}/spans",
107
+ options=make_request_options(
108
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
109
+ ),
110
+ cast_to=InvocationSpanListView,
111
+ )
112
+
113
+
114
+ class SpansResourceWithRawResponse:
115
+ def __init__(self, spans: SpansResource) -> None:
116
+ self._spans = spans
117
+
118
+ self.list = to_raw_response_wrapper(
119
+ spans.list,
120
+ )
121
+
122
+
123
+ class AsyncSpansResourceWithRawResponse:
124
+ def __init__(self, spans: AsyncSpansResource) -> None:
125
+ self._spans = spans
126
+
127
+ self.list = async_to_raw_response_wrapper(
128
+ spans.list,
129
+ )
130
+
131
+
132
+ class SpansResourceWithStreamingResponse:
133
+ def __init__(self, spans: SpansResource) -> None:
134
+ self._spans = spans
135
+
136
+ self.list = to_streamed_response_wrapper(
137
+ spans.list,
138
+ )
139
+
140
+
141
+ class AsyncSpansResourceWithStreamingResponse:
142
+ def __init__(self, spans: AsyncSpansResource) -> None:
143
+ self._spans = spans
144
+
145
+ self.list = async_to_streamed_response_wrapper(
146
+ spans.list,
147
+ )
@@ -0,0 +1,33 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .logs import (
4
+ LogsResource,
5
+ AsyncLogsResource,
6
+ LogsResourceWithRawResponse,
7
+ AsyncLogsResourceWithRawResponse,
8
+ LogsResourceWithStreamingResponse,
9
+ AsyncLogsResourceWithStreamingResponse,
10
+ )
11
+ from .projects import (
12
+ ProjectsResource,
13
+ AsyncProjectsResource,
14
+ ProjectsResourceWithRawResponse,
15
+ AsyncProjectsResourceWithRawResponse,
16
+ ProjectsResourceWithStreamingResponse,
17
+ AsyncProjectsResourceWithStreamingResponse,
18
+ )
19
+
20
+ __all__ = [
21
+ "LogsResource",
22
+ "AsyncLogsResource",
23
+ "LogsResourceWithRawResponse",
24
+ "AsyncLogsResourceWithRawResponse",
25
+ "LogsResourceWithStreamingResponse",
26
+ "AsyncLogsResourceWithStreamingResponse",
27
+ "ProjectsResource",
28
+ "AsyncProjectsResource",
29
+ "ProjectsResourceWithRawResponse",
30
+ "AsyncProjectsResourceWithRawResponse",
31
+ "ProjectsResourceWithStreamingResponse",
32
+ "AsyncProjectsResourceWithStreamingResponse",
33
+ ]
@@ -0,0 +1,143 @@
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
+ to_raw_response_wrapper,
12
+ to_streamed_response_wrapper,
13
+ async_to_raw_response_wrapper,
14
+ async_to_streamed_response_wrapper,
15
+ )
16
+ from ..._base_client import (
17
+ make_request_options,
18
+ )
19
+ from ...types.shared.project_logs_view import ProjectLogsView
20
+
21
+ __all__ = ["LogsResource", "AsyncLogsResource"]
22
+
23
+
24
+ class LogsResource(SyncAPIResource):
25
+ @cached_property
26
+ def with_raw_response(self) -> LogsResourceWithRawResponse:
27
+ return LogsResourceWithRawResponse(self)
28
+
29
+ @cached_property
30
+ def with_streaming_response(self) -> LogsResourceWithStreamingResponse:
31
+ return LogsResourceWithStreamingResponse(self)
32
+
33
+ def list(
34
+ self,
35
+ id: str,
36
+ *,
37
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
38
+ # The extra values given here take precedence over values defined on the client or passed to this method.
39
+ extra_headers: Headers | None = None,
40
+ extra_query: Query | None = None,
41
+ extra_body: Body | None = None,
42
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
43
+ ) -> ProjectLogsView:
44
+ """
45
+ Get list of all logs from a project.
46
+
47
+ Args:
48
+ extra_headers: Send extra headers
49
+
50
+ extra_query: Add additional query parameters to the request
51
+
52
+ extra_body: Add additional JSON properties to the request
53
+
54
+ timeout: Override the client-level default timeout for this request, in seconds
55
+ """
56
+ if not id:
57
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
58
+ return self._get(
59
+ f"/v1/projects/{id}/logs",
60
+ options=make_request_options(
61
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
62
+ ),
63
+ cast_to=ProjectLogsView,
64
+ )
65
+
66
+
67
+ class AsyncLogsResource(AsyncAPIResource):
68
+ @cached_property
69
+ def with_raw_response(self) -> AsyncLogsResourceWithRawResponse:
70
+ return AsyncLogsResourceWithRawResponse(self)
71
+
72
+ @cached_property
73
+ def with_streaming_response(self) -> AsyncLogsResourceWithStreamingResponse:
74
+ return AsyncLogsResourceWithStreamingResponse(self)
75
+
76
+ async def list(
77
+ self,
78
+ id: str,
79
+ *,
80
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
81
+ # The extra values given here take precedence over values defined on the client or passed to this method.
82
+ extra_headers: Headers | None = None,
83
+ extra_query: Query | None = None,
84
+ extra_body: Body | None = None,
85
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
86
+ ) -> ProjectLogsView:
87
+ """
88
+ Get list of all logs from a project.
89
+
90
+ Args:
91
+ extra_headers: Send extra headers
92
+
93
+ extra_query: Add additional query parameters to the request
94
+
95
+ extra_body: Add additional JSON properties to the request
96
+
97
+ timeout: Override the client-level default timeout for this request, in seconds
98
+ """
99
+ if not id:
100
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
101
+ return await self._get(
102
+ f"/v1/projects/{id}/logs",
103
+ options=make_request_options(
104
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
105
+ ),
106
+ cast_to=ProjectLogsView,
107
+ )
108
+
109
+
110
+ class LogsResourceWithRawResponse:
111
+ def __init__(self, logs: LogsResource) -> None:
112
+ self._logs = logs
113
+
114
+ self.list = to_raw_response_wrapper(
115
+ logs.list,
116
+ )
117
+
118
+
119
+ class AsyncLogsResourceWithRawResponse:
120
+ def __init__(self, logs: AsyncLogsResource) -> None:
121
+ self._logs = logs
122
+
123
+ self.list = async_to_raw_response_wrapper(
124
+ logs.list,
125
+ )
126
+
127
+
128
+ class LogsResourceWithStreamingResponse:
129
+ def __init__(self, logs: LogsResource) -> None:
130
+ self._logs = logs
131
+
132
+ self.list = to_streamed_response_wrapper(
133
+ logs.list,
134
+ )
135
+
136
+
137
+ class AsyncLogsResourceWithStreamingResponse:
138
+ def __init__(self, logs: AsyncLogsResource) -> None:
139
+ self._logs = logs
140
+
141
+ self.list = async_to_streamed_response_wrapper(
142
+ logs.list,
143
+ )