opencode-python-sdk 0.2.2__py3-none-any.whl → 0.2.3__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.
- opencode/__init__.py +9 -0
- opencode/_aiohttp.py +44 -0
- opencode/_base_client.py +237 -11
- opencode/_client.py +8 -2
- opencode/_logs.py +29 -0
- opencode/_pagination.py +14 -0
- opencode/_response.py +316 -0
- opencode/resources/agent.py +63 -0
- opencode/resources/command.py +59 -0
- opencode/resources/config.py +93 -20
- opencode/resources/credential.py +149 -56
- opencode/resources/debug.py +156 -20
- opencode/resources/event.py +59 -0
- opencode/resources/experimental.py +210 -36
- opencode/resources/file.py +71 -0
- opencode/resources/form.py +59 -0
- opencode/resources/generate.py +59 -0
- opencode/resources/integration.py +538 -128
- opencode/resources/location.py +87 -18
- opencode/resources/mcp.py +252 -82
- opencode/resources/message.py +59 -0
- opencode/resources/migration.py +126 -0
- opencode/resources/model.py +63 -0
- opencode/resources/permission.py +272 -38
- opencode/resources/plugin.py +95 -22
- opencode/resources/project.py +63 -0
- opencode/resources/provider.py +63 -0
- opencode/resources/pty.py +172 -20
- opencode/resources/reference.py +59 -0
- opencode/resources/rpc.py +59 -0
- opencode/resources/server.py +67 -0
- opencode/resources/session.py +1159 -405
- opencode/resources/shell.py +101 -20
- opencode/resources/skill.py +59 -0
- opencode/resources/vcs.py +172 -20
- opencode/resources/voice.py +59 -0
- opencode/resources/websearch.py +63 -0
- opencode/resources/worktree.py +123 -40
- {opencode_python_sdk-0.2.2.dist-info → opencode_python_sdk-0.2.3.dist-info}/METADATA +90 -2
- opencode_python_sdk-0.2.3.dist-info/RECORD +67 -0
- opencode_python_sdk-0.2.2.dist-info/RECORD +0 -64
- {opencode_python_sdk-0.2.2.dist-info → opencode_python_sdk-0.2.3.dist-info}/WHEEL +0 -0
- {opencode_python_sdk-0.2.2.dist-info → opencode_python_sdk-0.2.3.dist-info}/licenses/LICENSE +0 -0
opencode/resources/credential.py
CHANGED
|
@@ -6,11 +6,18 @@
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
8
|
import builtins
|
|
9
|
+
from functools import cached_property
|
|
9
10
|
from typing import TYPE_CHECKING, cast
|
|
10
11
|
|
|
11
12
|
from .._base_client import RequestOptions
|
|
12
13
|
from .._qs import encode_path_segment
|
|
13
14
|
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
15
|
+
from .._response import (
|
|
16
|
+
async_to_raw_response_wrapper,
|
|
17
|
+
async_to_streamed_response_wrapper,
|
|
18
|
+
to_raw_response_wrapper,
|
|
19
|
+
to_streamed_response_wrapper,
|
|
20
|
+
)
|
|
14
21
|
from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
|
|
15
22
|
|
|
16
23
|
if TYPE_CHECKING:
|
|
@@ -27,6 +34,16 @@ __all__ = ["CredentialResource", "AsyncCredentialResource"]
|
|
|
27
34
|
class CredentialResource(SyncAPIResource):
|
|
28
35
|
"""Operations under ``client.credential`` (OpenCode ``credential``)."""
|
|
29
36
|
|
|
37
|
+
@cached_property
|
|
38
|
+
def with_raw_response(self) -> CredentialResourceWithRawResponse:
|
|
39
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
40
|
+
return CredentialResourceWithRawResponse(self)
|
|
41
|
+
|
|
42
|
+
@cached_property
|
|
43
|
+
def with_streaming_response(self) -> CredentialResourceWithStreamingResponse:
|
|
44
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
45
|
+
return CredentialResourceWithStreamingResponse(self)
|
|
46
|
+
|
|
30
47
|
def list(
|
|
31
48
|
self,
|
|
32
49
|
*,
|
|
@@ -128,17 +145,20 @@ class CredentialResource(SyncAPIResource):
|
|
|
128
145
|
|
|
129
146
|
``PATCH /api/credential/:credentialID``
|
|
130
147
|
"""
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
148
|
+
return cast(
|
|
149
|
+
"None",
|
|
150
|
+
self._client.request(
|
|
151
|
+
RequestOptions(
|
|
152
|
+
method="PATCH",
|
|
153
|
+
path=f"/api/credential/{encode_path_segment(credential_id)}",
|
|
154
|
+
body={"label": label},
|
|
155
|
+
extra_headers=extra_headers,
|
|
156
|
+
extra_query=extra_query,
|
|
157
|
+
extra_body=extra_body,
|
|
158
|
+
timeout=timeout,
|
|
159
|
+
),
|
|
160
|
+
kind="void",
|
|
140
161
|
),
|
|
141
|
-
kind="void",
|
|
142
162
|
)
|
|
143
163
|
|
|
144
164
|
def activate(
|
|
@@ -160,16 +180,19 @@ class CredentialResource(SyncAPIResource):
|
|
|
160
180
|
|
|
161
181
|
``POST /api/credential/:credentialID/activate``
|
|
162
182
|
"""
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
183
|
+
return cast(
|
|
184
|
+
"None",
|
|
185
|
+
self._client.request(
|
|
186
|
+
RequestOptions(
|
|
187
|
+
method="POST",
|
|
188
|
+
path=f"/api/credential/{encode_path_segment(credential_id)}/activate",
|
|
189
|
+
extra_headers=extra_headers,
|
|
190
|
+
extra_query=extra_query,
|
|
191
|
+
extra_body=extra_body,
|
|
192
|
+
timeout=timeout,
|
|
193
|
+
),
|
|
194
|
+
kind="void",
|
|
171
195
|
),
|
|
172
|
-
kind="void",
|
|
173
196
|
)
|
|
174
197
|
|
|
175
198
|
def remove(
|
|
@@ -191,22 +214,59 @@ class CredentialResource(SyncAPIResource):
|
|
|
191
214
|
|
|
192
215
|
``DELETE /api/credential/:credentialID``
|
|
193
216
|
"""
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
217
|
+
return cast(
|
|
218
|
+
"None",
|
|
219
|
+
self._client.request(
|
|
220
|
+
RequestOptions(
|
|
221
|
+
method="DELETE",
|
|
222
|
+
path=f"/api/credential/{encode_path_segment(credential_id)}",
|
|
223
|
+
extra_headers=extra_headers,
|
|
224
|
+
extra_query=extra_query,
|
|
225
|
+
extra_body=extra_body,
|
|
226
|
+
timeout=timeout,
|
|
227
|
+
),
|
|
228
|
+
kind="void",
|
|
202
229
|
),
|
|
203
|
-
kind="void",
|
|
204
230
|
)
|
|
205
231
|
|
|
206
232
|
|
|
233
|
+
class CredentialResourceWithRawResponse:
|
|
234
|
+
"""``client.credential.with_raw_response``."""
|
|
235
|
+
|
|
236
|
+
def __init__(self, resource: CredentialResource) -> None:
|
|
237
|
+
self._resource = resource
|
|
238
|
+
self.list = to_raw_response_wrapper(resource.list)
|
|
239
|
+
self.create = to_raw_response_wrapper(resource.create)
|
|
240
|
+
self.update = to_raw_response_wrapper(resource.update)
|
|
241
|
+
self.activate = to_raw_response_wrapper(resource.activate)
|
|
242
|
+
self.remove = to_raw_response_wrapper(resource.remove)
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
class CredentialResourceWithStreamingResponse:
|
|
246
|
+
"""``client.credential.with_streaming_response``."""
|
|
247
|
+
|
|
248
|
+
def __init__(self, resource: CredentialResource) -> None:
|
|
249
|
+
self._resource = resource
|
|
250
|
+
self.list = to_streamed_response_wrapper(resource.list)
|
|
251
|
+
self.create = to_streamed_response_wrapper(resource.create)
|
|
252
|
+
self.update = to_streamed_response_wrapper(resource.update)
|
|
253
|
+
self.activate = to_streamed_response_wrapper(resource.activate)
|
|
254
|
+
self.remove = to_streamed_response_wrapper(resource.remove)
|
|
255
|
+
|
|
256
|
+
|
|
207
257
|
class AsyncCredentialResource(AsyncAPIResource):
|
|
208
258
|
"""Operations under ``client.credential`` (OpenCode ``credential``)."""
|
|
209
259
|
|
|
260
|
+
@cached_property
|
|
261
|
+
def with_raw_response(self) -> AsyncCredentialResourceWithRawResponse:
|
|
262
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
263
|
+
return AsyncCredentialResourceWithRawResponse(self)
|
|
264
|
+
|
|
265
|
+
@cached_property
|
|
266
|
+
def with_streaming_response(self) -> AsyncCredentialResourceWithStreamingResponse:
|
|
267
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
268
|
+
return AsyncCredentialResourceWithStreamingResponse(self)
|
|
269
|
+
|
|
210
270
|
async def list(
|
|
211
271
|
self,
|
|
212
272
|
*,
|
|
@@ -308,17 +368,20 @@ class AsyncCredentialResource(AsyncAPIResource):
|
|
|
308
368
|
|
|
309
369
|
``PATCH /api/credential/:credentialID``
|
|
310
370
|
"""
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
371
|
+
return cast(
|
|
372
|
+
"None",
|
|
373
|
+
await self._client.request(
|
|
374
|
+
RequestOptions(
|
|
375
|
+
method="PATCH",
|
|
376
|
+
path=f"/api/credential/{encode_path_segment(credential_id)}",
|
|
377
|
+
body={"label": label},
|
|
378
|
+
extra_headers=extra_headers,
|
|
379
|
+
extra_query=extra_query,
|
|
380
|
+
extra_body=extra_body,
|
|
381
|
+
timeout=timeout,
|
|
382
|
+
),
|
|
383
|
+
kind="void",
|
|
320
384
|
),
|
|
321
|
-
kind="void",
|
|
322
385
|
)
|
|
323
386
|
|
|
324
387
|
async def activate(
|
|
@@ -340,16 +403,19 @@ class AsyncCredentialResource(AsyncAPIResource):
|
|
|
340
403
|
|
|
341
404
|
``POST /api/credential/:credentialID/activate``
|
|
342
405
|
"""
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
406
|
+
return cast(
|
|
407
|
+
"None",
|
|
408
|
+
await self._client.request(
|
|
409
|
+
RequestOptions(
|
|
410
|
+
method="POST",
|
|
411
|
+
path=f"/api/credential/{encode_path_segment(credential_id)}/activate",
|
|
412
|
+
extra_headers=extra_headers,
|
|
413
|
+
extra_query=extra_query,
|
|
414
|
+
extra_body=extra_body,
|
|
415
|
+
timeout=timeout,
|
|
416
|
+
),
|
|
417
|
+
kind="void",
|
|
351
418
|
),
|
|
352
|
-
kind="void",
|
|
353
419
|
)
|
|
354
420
|
|
|
355
421
|
async def remove(
|
|
@@ -371,14 +437,41 @@ class AsyncCredentialResource(AsyncAPIResource):
|
|
|
371
437
|
|
|
372
438
|
``DELETE /api/credential/:credentialID``
|
|
373
439
|
"""
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
440
|
+
return cast(
|
|
441
|
+
"None",
|
|
442
|
+
await self._client.request(
|
|
443
|
+
RequestOptions(
|
|
444
|
+
method="DELETE",
|
|
445
|
+
path=f"/api/credential/{encode_path_segment(credential_id)}",
|
|
446
|
+
extra_headers=extra_headers,
|
|
447
|
+
extra_query=extra_query,
|
|
448
|
+
extra_body=extra_body,
|
|
449
|
+
timeout=timeout,
|
|
450
|
+
),
|
|
451
|
+
kind="void",
|
|
382
452
|
),
|
|
383
|
-
kind="void",
|
|
384
453
|
)
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
class AsyncCredentialResourceWithRawResponse:
|
|
457
|
+
"""``client.credential.with_raw_response``."""
|
|
458
|
+
|
|
459
|
+
def __init__(self, resource: AsyncCredentialResource) -> None:
|
|
460
|
+
self._resource = resource
|
|
461
|
+
self.list = async_to_raw_response_wrapper(resource.list)
|
|
462
|
+
self.create = async_to_raw_response_wrapper(resource.create)
|
|
463
|
+
self.update = async_to_raw_response_wrapper(resource.update)
|
|
464
|
+
self.activate = async_to_raw_response_wrapper(resource.activate)
|
|
465
|
+
self.remove = async_to_raw_response_wrapper(resource.remove)
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
class AsyncCredentialResourceWithStreamingResponse:
|
|
469
|
+
"""``client.credential.with_streaming_response``."""
|
|
470
|
+
|
|
471
|
+
def __init__(self, resource: AsyncCredentialResource) -> None:
|
|
472
|
+
self._resource = resource
|
|
473
|
+
self.list = async_to_streamed_response_wrapper(resource.list)
|
|
474
|
+
self.create = async_to_streamed_response_wrapper(resource.create)
|
|
475
|
+
self.update = async_to_streamed_response_wrapper(resource.update)
|
|
476
|
+
self.activate = async_to_streamed_response_wrapper(resource.activate)
|
|
477
|
+
self.remove = async_to_streamed_response_wrapper(resource.remove)
|
opencode/resources/debug.py
CHANGED
|
@@ -11,6 +11,12 @@ from typing import TYPE_CHECKING, cast
|
|
|
11
11
|
|
|
12
12
|
from .._base_client import RequestOptions
|
|
13
13
|
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
14
|
+
from .._response import (
|
|
15
|
+
async_to_raw_response_wrapper,
|
|
16
|
+
async_to_streamed_response_wrapper,
|
|
17
|
+
to_raw_response_wrapper,
|
|
18
|
+
to_streamed_response_wrapper,
|
|
19
|
+
)
|
|
14
20
|
from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
|
|
15
21
|
|
|
16
22
|
if TYPE_CHECKING:
|
|
@@ -25,6 +31,16 @@ __all__ = ["DebugResource", "AsyncDebugResource"]
|
|
|
25
31
|
class DebugLocationResource(SyncAPIResource):
|
|
26
32
|
"""Operations under ``client.debug.location`` (OpenCode ``debug.location``)."""
|
|
27
33
|
|
|
34
|
+
@cached_property
|
|
35
|
+
def with_raw_response(self) -> DebugLocationResourceWithRawResponse:
|
|
36
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
37
|
+
return DebugLocationResourceWithRawResponse(self)
|
|
38
|
+
|
|
39
|
+
@cached_property
|
|
40
|
+
def with_streaming_response(self) -> DebugLocationResourceWithStreamingResponse:
|
|
41
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
42
|
+
return DebugLocationResourceWithStreamingResponse(self)
|
|
43
|
+
|
|
28
44
|
def list(
|
|
29
45
|
self,
|
|
30
46
|
*,
|
|
@@ -77,20 +93,41 @@ class DebugLocationResource(SyncAPIResource):
|
|
|
77
93
|
|
|
78
94
|
``DELETE /api/debug/location``
|
|
79
95
|
"""
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
96
|
+
return cast(
|
|
97
|
+
"None",
|
|
98
|
+
self._client.request(
|
|
99
|
+
RequestOptions(
|
|
100
|
+
method="DELETE",
|
|
101
|
+
path="/api/debug/location",
|
|
102
|
+
query={"location": self._location(location)},
|
|
103
|
+
extra_headers=extra_headers,
|
|
104
|
+
extra_query=extra_query,
|
|
105
|
+
extra_body=extra_body,
|
|
106
|
+
timeout=timeout,
|
|
107
|
+
),
|
|
108
|
+
kind="void",
|
|
89
109
|
),
|
|
90
|
-
kind="void",
|
|
91
110
|
)
|
|
92
111
|
|
|
93
112
|
|
|
113
|
+
class DebugLocationResourceWithRawResponse:
|
|
114
|
+
"""``client.debug.location.with_raw_response``."""
|
|
115
|
+
|
|
116
|
+
def __init__(self, resource: DebugLocationResource) -> None:
|
|
117
|
+
self._resource = resource
|
|
118
|
+
self.list = to_raw_response_wrapper(resource.list)
|
|
119
|
+
self.evict = to_raw_response_wrapper(resource.evict)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
class DebugLocationResourceWithStreamingResponse:
|
|
123
|
+
"""``client.debug.location.with_streaming_response``."""
|
|
124
|
+
|
|
125
|
+
def __init__(self, resource: DebugLocationResource) -> None:
|
|
126
|
+
self._resource = resource
|
|
127
|
+
self.list = to_streamed_response_wrapper(resource.list)
|
|
128
|
+
self.evict = to_streamed_response_wrapper(resource.evict)
|
|
129
|
+
|
|
130
|
+
|
|
94
131
|
class DebugResource(SyncAPIResource):
|
|
95
132
|
"""Operations under ``client.debug`` (OpenCode ``debug``)."""
|
|
96
133
|
|
|
@@ -99,10 +136,54 @@ class DebugResource(SyncAPIResource):
|
|
|
99
136
|
"""Operations under ``client.debug.location``."""
|
|
100
137
|
return DebugLocationResource(self._client)
|
|
101
138
|
|
|
139
|
+
@cached_property
|
|
140
|
+
def with_raw_response(self) -> DebugResourceWithRawResponse:
|
|
141
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
142
|
+
return DebugResourceWithRawResponse(self)
|
|
143
|
+
|
|
144
|
+
@cached_property
|
|
145
|
+
def with_streaming_response(self) -> DebugResourceWithStreamingResponse:
|
|
146
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
147
|
+
return DebugResourceWithStreamingResponse(self)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
class DebugResourceWithRawResponse:
|
|
151
|
+
"""``client.debug.with_raw_response``."""
|
|
152
|
+
|
|
153
|
+
def __init__(self, resource: DebugResource) -> None:
|
|
154
|
+
self._resource = resource
|
|
155
|
+
|
|
156
|
+
@cached_property
|
|
157
|
+
def location(self) -> DebugLocationResourceWithRawResponse:
|
|
158
|
+
"""``client.debug.location.with_raw_response``."""
|
|
159
|
+
return DebugLocationResourceWithRawResponse(self._resource.location)
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
class DebugResourceWithStreamingResponse:
|
|
163
|
+
"""``client.debug.with_streaming_response``."""
|
|
164
|
+
|
|
165
|
+
def __init__(self, resource: DebugResource) -> None:
|
|
166
|
+
self._resource = resource
|
|
167
|
+
|
|
168
|
+
@cached_property
|
|
169
|
+
def location(self) -> DebugLocationResourceWithStreamingResponse:
|
|
170
|
+
"""``client.debug.location.with_streaming_response``."""
|
|
171
|
+
return DebugLocationResourceWithStreamingResponse(self._resource.location)
|
|
172
|
+
|
|
102
173
|
|
|
103
174
|
class AsyncDebugLocationResource(AsyncAPIResource):
|
|
104
175
|
"""Operations under ``client.debug.location`` (OpenCode ``debug.location``)."""
|
|
105
176
|
|
|
177
|
+
@cached_property
|
|
178
|
+
def with_raw_response(self) -> AsyncDebugLocationResourceWithRawResponse:
|
|
179
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
180
|
+
return AsyncDebugLocationResourceWithRawResponse(self)
|
|
181
|
+
|
|
182
|
+
@cached_property
|
|
183
|
+
def with_streaming_response(self) -> AsyncDebugLocationResourceWithStreamingResponse:
|
|
184
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
185
|
+
return AsyncDebugLocationResourceWithStreamingResponse(self)
|
|
186
|
+
|
|
106
187
|
async def list(
|
|
107
188
|
self,
|
|
108
189
|
*,
|
|
@@ -155,20 +236,41 @@ class AsyncDebugLocationResource(AsyncAPIResource):
|
|
|
155
236
|
|
|
156
237
|
``DELETE /api/debug/location``
|
|
157
238
|
"""
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
239
|
+
return cast(
|
|
240
|
+
"None",
|
|
241
|
+
await self._client.request(
|
|
242
|
+
RequestOptions(
|
|
243
|
+
method="DELETE",
|
|
244
|
+
path="/api/debug/location",
|
|
245
|
+
query={"location": self._location(location)},
|
|
246
|
+
extra_headers=extra_headers,
|
|
247
|
+
extra_query=extra_query,
|
|
248
|
+
extra_body=extra_body,
|
|
249
|
+
timeout=timeout,
|
|
250
|
+
),
|
|
251
|
+
kind="void",
|
|
167
252
|
),
|
|
168
|
-
kind="void",
|
|
169
253
|
)
|
|
170
254
|
|
|
171
255
|
|
|
256
|
+
class AsyncDebugLocationResourceWithRawResponse:
|
|
257
|
+
"""``client.debug.location.with_raw_response``."""
|
|
258
|
+
|
|
259
|
+
def __init__(self, resource: AsyncDebugLocationResource) -> None:
|
|
260
|
+
self._resource = resource
|
|
261
|
+
self.list = async_to_raw_response_wrapper(resource.list)
|
|
262
|
+
self.evict = async_to_raw_response_wrapper(resource.evict)
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
class AsyncDebugLocationResourceWithStreamingResponse:
|
|
266
|
+
"""``client.debug.location.with_streaming_response``."""
|
|
267
|
+
|
|
268
|
+
def __init__(self, resource: AsyncDebugLocationResource) -> None:
|
|
269
|
+
self._resource = resource
|
|
270
|
+
self.list = async_to_streamed_response_wrapper(resource.list)
|
|
271
|
+
self.evict = async_to_streamed_response_wrapper(resource.evict)
|
|
272
|
+
|
|
273
|
+
|
|
172
274
|
class AsyncDebugResource(AsyncAPIResource):
|
|
173
275
|
"""Operations under ``client.debug`` (OpenCode ``debug``)."""
|
|
174
276
|
|
|
@@ -176,3 +278,37 @@ class AsyncDebugResource(AsyncAPIResource):
|
|
|
176
278
|
def location(self) -> AsyncDebugLocationResource:
|
|
177
279
|
"""Operations under ``client.debug.location``."""
|
|
178
280
|
return AsyncDebugLocationResource(self._client)
|
|
281
|
+
|
|
282
|
+
@cached_property
|
|
283
|
+
def with_raw_response(self) -> AsyncDebugResourceWithRawResponse:
|
|
284
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
285
|
+
return AsyncDebugResourceWithRawResponse(self)
|
|
286
|
+
|
|
287
|
+
@cached_property
|
|
288
|
+
def with_streaming_response(self) -> AsyncDebugResourceWithStreamingResponse:
|
|
289
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
290
|
+
return AsyncDebugResourceWithStreamingResponse(self)
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
class AsyncDebugResourceWithRawResponse:
|
|
294
|
+
"""``client.debug.with_raw_response``."""
|
|
295
|
+
|
|
296
|
+
def __init__(self, resource: AsyncDebugResource) -> None:
|
|
297
|
+
self._resource = resource
|
|
298
|
+
|
|
299
|
+
@cached_property
|
|
300
|
+
def location(self) -> AsyncDebugLocationResourceWithRawResponse:
|
|
301
|
+
"""``client.debug.location.with_raw_response``."""
|
|
302
|
+
return AsyncDebugLocationResourceWithRawResponse(self._resource.location)
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
class AsyncDebugResourceWithStreamingResponse:
|
|
306
|
+
"""``client.debug.with_streaming_response``."""
|
|
307
|
+
|
|
308
|
+
def __init__(self, resource: AsyncDebugResource) -> None:
|
|
309
|
+
self._resource = resource
|
|
310
|
+
|
|
311
|
+
@cached_property
|
|
312
|
+
def location(self) -> AsyncDebugLocationResourceWithStreamingResponse:
|
|
313
|
+
"""``client.debug.location.with_streaming_response``."""
|
|
314
|
+
return AsyncDebugLocationResourceWithStreamingResponse(self._resource.location)
|
opencode/resources/event.py
CHANGED
|
@@ -5,10 +5,17 @@
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
+
from functools import cached_property
|
|
8
9
|
from typing import TYPE_CHECKING
|
|
9
10
|
|
|
10
11
|
from .._base_client import RequestOptions
|
|
11
12
|
from .._resource import AsyncAPIResource, SyncAPIResource
|
|
13
|
+
from .._response import (
|
|
14
|
+
async_to_raw_response_wrapper,
|
|
15
|
+
async_to_streamed_response_wrapper,
|
|
16
|
+
to_raw_response_wrapper,
|
|
17
|
+
to_streamed_response_wrapper,
|
|
18
|
+
)
|
|
12
19
|
from .._streaming import AsyncStream, Stream
|
|
13
20
|
from .._types import NOT_GIVEN, Body, Headers, NotGiven, Query, Timeout
|
|
14
21
|
|
|
@@ -23,6 +30,16 @@ __all__ = ["EventResource", "AsyncEventResource"]
|
|
|
23
30
|
class EventResource(SyncAPIResource):
|
|
24
31
|
"""Operations under ``client.event`` (OpenCode ``event``)."""
|
|
25
32
|
|
|
33
|
+
@cached_property
|
|
34
|
+
def with_raw_response(self) -> EventResourceWithRawResponse:
|
|
35
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
36
|
+
return EventResourceWithRawResponse(self)
|
|
37
|
+
|
|
38
|
+
@cached_property
|
|
39
|
+
def with_streaming_response(self) -> EventResourceWithStreamingResponse:
|
|
40
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
41
|
+
return EventResourceWithStreamingResponse(self)
|
|
42
|
+
|
|
26
43
|
def subscribe(
|
|
27
44
|
self,
|
|
28
45
|
*,
|
|
@@ -54,9 +71,35 @@ class EventResource(SyncAPIResource):
|
|
|
54
71
|
)
|
|
55
72
|
|
|
56
73
|
|
|
74
|
+
class EventResourceWithRawResponse:
|
|
75
|
+
"""``client.event.with_raw_response``."""
|
|
76
|
+
|
|
77
|
+
def __init__(self, resource: EventResource) -> None:
|
|
78
|
+
self._resource = resource
|
|
79
|
+
self.subscribe = to_raw_response_wrapper(resource.subscribe)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
class EventResourceWithStreamingResponse:
|
|
83
|
+
"""``client.event.with_streaming_response``."""
|
|
84
|
+
|
|
85
|
+
def __init__(self, resource: EventResource) -> None:
|
|
86
|
+
self._resource = resource
|
|
87
|
+
self.subscribe = to_streamed_response_wrapper(resource.subscribe)
|
|
88
|
+
|
|
89
|
+
|
|
57
90
|
class AsyncEventResource(AsyncAPIResource):
|
|
58
91
|
"""Operations under ``client.event`` (OpenCode ``event``)."""
|
|
59
92
|
|
|
93
|
+
@cached_property
|
|
94
|
+
def with_raw_response(self) -> AsyncEventResourceWithRawResponse:
|
|
95
|
+
"""Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
|
|
96
|
+
return AsyncEventResourceWithRawResponse(self)
|
|
97
|
+
|
|
98
|
+
@cached_property
|
|
99
|
+
def with_streaming_response(self) -> AsyncEventResourceWithStreamingResponse:
|
|
100
|
+
"""Same methods, returning a context manager over the HTTP response without reading the body."""
|
|
101
|
+
return AsyncEventResourceWithStreamingResponse(self)
|
|
102
|
+
|
|
60
103
|
async def subscribe(
|
|
61
104
|
self,
|
|
62
105
|
*,
|
|
@@ -86,3 +129,19 @@ class AsyncEventResource(AsyncAPIResource):
|
|
|
86
129
|
),
|
|
87
130
|
item_type="Event",
|
|
88
131
|
)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
class AsyncEventResourceWithRawResponse:
|
|
135
|
+
"""``client.event.with_raw_response``."""
|
|
136
|
+
|
|
137
|
+
def __init__(self, resource: AsyncEventResource) -> None:
|
|
138
|
+
self._resource = resource
|
|
139
|
+
self.subscribe = async_to_raw_response_wrapper(resource.subscribe)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
class AsyncEventResourceWithStreamingResponse:
|
|
143
|
+
"""``client.event.with_streaming_response``."""
|
|
144
|
+
|
|
145
|
+
def __init__(self, resource: AsyncEventResource) -> None:
|
|
146
|
+
self._resource = resource
|
|
147
|
+
self.subscribe = async_to_streamed_response_wrapper(resource.subscribe)
|