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.
Files changed (43) hide show
  1. opencode/__init__.py +9 -0
  2. opencode/_aiohttp.py +44 -0
  3. opencode/_base_client.py +237 -11
  4. opencode/_client.py +8 -2
  5. opencode/_logs.py +29 -0
  6. opencode/_pagination.py +14 -0
  7. opencode/_response.py +316 -0
  8. opencode/resources/agent.py +63 -0
  9. opencode/resources/command.py +59 -0
  10. opencode/resources/config.py +93 -20
  11. opencode/resources/credential.py +149 -56
  12. opencode/resources/debug.py +156 -20
  13. opencode/resources/event.py +59 -0
  14. opencode/resources/experimental.py +210 -36
  15. opencode/resources/file.py +71 -0
  16. opencode/resources/form.py +59 -0
  17. opencode/resources/generate.py +59 -0
  18. opencode/resources/integration.py +538 -128
  19. opencode/resources/location.py +87 -18
  20. opencode/resources/mcp.py +252 -82
  21. opencode/resources/message.py +59 -0
  22. opencode/resources/migration.py +126 -0
  23. opencode/resources/model.py +63 -0
  24. opencode/resources/permission.py +272 -38
  25. opencode/resources/plugin.py +95 -22
  26. opencode/resources/project.py +63 -0
  27. opencode/resources/provider.py +63 -0
  28. opencode/resources/pty.py +172 -20
  29. opencode/resources/reference.py +59 -0
  30. opencode/resources/rpc.py +59 -0
  31. opencode/resources/server.py +67 -0
  32. opencode/resources/session.py +1159 -405
  33. opencode/resources/shell.py +101 -20
  34. opencode/resources/skill.py +59 -0
  35. opencode/resources/vcs.py +172 -20
  36. opencode/resources/voice.py +59 -0
  37. opencode/resources/websearch.py +63 -0
  38. opencode/resources/worktree.py +123 -40
  39. {opencode_python_sdk-0.2.2.dist-info → opencode_python_sdk-0.2.3.dist-info}/METADATA +90 -2
  40. opencode_python_sdk-0.2.3.dist-info/RECORD +67 -0
  41. opencode_python_sdk-0.2.2.dist-info/RECORD +0 -64
  42. {opencode_python_sdk-0.2.2.dist-info → opencode_python_sdk-0.2.3.dist-info}/WHEEL +0 -0
  43. {opencode_python_sdk-0.2.2.dist-info → opencode_python_sdk-0.2.3.dist-info}/licenses/LICENSE +0 -0
@@ -11,6 +11,12 @@ from typing import TYPE_CHECKING, cast
11
11
  from .._base_client import RequestOptions
12
12
  from .._qs import encode_path_segment
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:
@@ -34,6 +40,16 @@ __all__ = ["IntegrationResource", "AsyncIntegrationResource"]
34
40
  class IntegrationWellknownResource(SyncAPIResource):
35
41
  """Operations under ``client.integration.wellknown`` (OpenCode ``integration.wellknown``)."""
36
42
 
43
+ @cached_property
44
+ def with_raw_response(self) -> IntegrationWellknownResourceWithRawResponse:
45
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
46
+ return IntegrationWellknownResourceWithRawResponse(self)
47
+
48
+ @cached_property
49
+ def with_streaming_response(self) -> IntegrationWellknownResourceWithStreamingResponse:
50
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
51
+ return IntegrationWellknownResourceWithStreamingResponse(self)
52
+
37
53
  def add(
38
54
  self,
39
55
  *,
@@ -57,24 +73,53 @@ class IntegrationWellknownResource(SyncAPIResource):
57
73
 
58
74
  ``POST /api/experimental/integration/wellknown``
59
75
  """
60
- self._client.request(
61
- RequestOptions(
62
- method="POST",
63
- path="/api/experimental/integration/wellknown",
64
- query={"location": self._location(location)},
65
- body={"url": url},
66
- extra_headers=extra_headers,
67
- extra_query=extra_query,
68
- extra_body=extra_body,
69
- timeout=timeout,
76
+ return cast(
77
+ "None",
78
+ self._client.request(
79
+ RequestOptions(
80
+ method="POST",
81
+ path="/api/experimental/integration/wellknown",
82
+ query={"location": self._location(location)},
83
+ body={"url": url},
84
+ extra_headers=extra_headers,
85
+ extra_query=extra_query,
86
+ extra_body=extra_body,
87
+ timeout=timeout,
88
+ ),
89
+ kind="void",
70
90
  ),
71
- kind="void",
72
91
  )
73
92
 
74
93
 
94
+ class IntegrationWellknownResourceWithRawResponse:
95
+ """``client.integration.wellknown.with_raw_response``."""
96
+
97
+ def __init__(self, resource: IntegrationWellknownResource) -> None:
98
+ self._resource = resource
99
+ self.add = to_raw_response_wrapper(resource.add)
100
+
101
+
102
+ class IntegrationWellknownResourceWithStreamingResponse:
103
+ """``client.integration.wellknown.with_streaming_response``."""
104
+
105
+ def __init__(self, resource: IntegrationWellknownResource) -> None:
106
+ self._resource = resource
107
+ self.add = to_streamed_response_wrapper(resource.add)
108
+
109
+
75
110
  class IntegrationConnectResource(SyncAPIResource):
76
111
  """Operations under ``client.integration.connect`` (OpenCode ``integration.connect``)."""
77
112
 
113
+ @cached_property
114
+ def with_raw_response(self) -> IntegrationConnectResourceWithRawResponse:
115
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
116
+ return IntegrationConnectResourceWithRawResponse(self)
117
+
118
+ @cached_property
119
+ def with_streaming_response(self) -> IntegrationConnectResourceWithStreamingResponse:
120
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
121
+ return IntegrationConnectResourceWithStreamingResponse(self)
122
+
78
123
  def key(
79
124
  self,
80
125
  integration_id: IntegrationID,
@@ -100,18 +145,21 @@ class IntegrationConnectResource(SyncAPIResource):
100
145
 
101
146
  ``POST /api/integration/:integrationID/connect/key``
102
147
  """
103
- self._client.request(
104
- RequestOptions(
105
- method="POST",
106
- path=f"/api/integration/{encode_path_segment(integration_id)}/connect/key",
107
- query={"location": self._location(location)},
108
- body={"key": key, "answer": answer, "label": label},
109
- extra_headers=extra_headers,
110
- extra_query=extra_query,
111
- extra_body=extra_body,
112
- timeout=timeout,
148
+ return cast(
149
+ "None",
150
+ self._client.request(
151
+ RequestOptions(
152
+ method="POST",
153
+ path=f"/api/integration/{encode_path_segment(integration_id)}/connect/key",
154
+ query={"location": self._location(location)},
155
+ body={"key": key, "answer": answer, "label": label},
156
+ extra_headers=extra_headers,
157
+ extra_query=extra_query,
158
+ extra_body=extra_body,
159
+ timeout=timeout,
160
+ ),
161
+ kind="void",
113
162
  ),
114
- kind="void",
115
163
  )
116
164
 
117
165
  def external(
@@ -139,24 +187,55 @@ class IntegrationConnectResource(SyncAPIResource):
139
187
 
140
188
  ``POST /api/integration/:integrationID/connect/external``
141
189
  """
142
- self._client.request(
143
- RequestOptions(
144
- method="POST",
145
- path=f"/api/integration/{encode_path_segment(integration_id)}/connect/external",
146
- query={"location": self._location(location)},
147
- body={"methodID": method_id, "answer": answer, "label": label},
148
- extra_headers=extra_headers,
149
- extra_query=extra_query,
150
- extra_body=extra_body,
151
- timeout=timeout,
190
+ return cast(
191
+ "None",
192
+ self._client.request(
193
+ RequestOptions(
194
+ method="POST",
195
+ path=f"/api/integration/{encode_path_segment(integration_id)}/connect/external",
196
+ query={"location": self._location(location)},
197
+ body={"methodID": method_id, "answer": answer, "label": label},
198
+ extra_headers=extra_headers,
199
+ extra_query=extra_query,
200
+ extra_body=extra_body,
201
+ timeout=timeout,
202
+ ),
203
+ kind="void",
152
204
  ),
153
- kind="void",
154
205
  )
155
206
 
156
207
 
208
+ class IntegrationConnectResourceWithRawResponse:
209
+ """``client.integration.connect.with_raw_response``."""
210
+
211
+ def __init__(self, resource: IntegrationConnectResource) -> None:
212
+ self._resource = resource
213
+ self.key = to_raw_response_wrapper(resource.key)
214
+ self.external = to_raw_response_wrapper(resource.external)
215
+
216
+
217
+ class IntegrationConnectResourceWithStreamingResponse:
218
+ """``client.integration.connect.with_streaming_response``."""
219
+
220
+ def __init__(self, resource: IntegrationConnectResource) -> None:
221
+ self._resource = resource
222
+ self.key = to_streamed_response_wrapper(resource.key)
223
+ self.external = to_streamed_response_wrapper(resource.external)
224
+
225
+
157
226
  class IntegrationOauthResource(SyncAPIResource):
158
227
  """Operations under ``client.integration.oauth`` (OpenCode ``integration.oauth``)."""
159
228
 
229
+ @cached_property
230
+ def with_raw_response(self) -> IntegrationOauthResourceWithRawResponse:
231
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
232
+ return IntegrationOauthResourceWithRawResponse(self)
233
+
234
+ @cached_property
235
+ def with_streaming_response(self) -> IntegrationOauthResourceWithStreamingResponse:
236
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
237
+ return IntegrationOauthResourceWithStreamingResponse(self)
238
+
160
239
  def connect(
161
240
  self,
162
241
  integration_id: IntegrationID,
@@ -263,18 +342,21 @@ class IntegrationOauthResource(SyncAPIResource):
263
342
 
264
343
  ``POST /api/integration/:integrationID/connect/oauth/:attemptID/complete``
265
344
  """
266
- self._client.request(
267
- RequestOptions(
268
- method="POST",
269
- path=f"/api/integration/{encode_path_segment(integration_id)}/connect/oauth/{encode_path_segment(attempt_id)}/complete",
270
- query={"location": self._location(location)},
271
- body={"code": code},
272
- extra_headers=extra_headers,
273
- extra_query=extra_query,
274
- extra_body=extra_body,
275
- timeout=timeout,
345
+ return cast(
346
+ "None",
347
+ self._client.request(
348
+ RequestOptions(
349
+ method="POST",
350
+ path=f"/api/integration/{encode_path_segment(integration_id)}/connect/oauth/{encode_path_segment(attempt_id)}/complete",
351
+ query={"location": self._location(location)},
352
+ body={"code": code},
353
+ extra_headers=extra_headers,
354
+ extra_query=extra_query,
355
+ extra_body=extra_body,
356
+ timeout=timeout,
357
+ ),
358
+ kind="void",
276
359
  ),
277
- kind="void",
278
360
  )
279
361
 
280
362
  def cancel(
@@ -299,23 +381,58 @@ class IntegrationOauthResource(SyncAPIResource):
299
381
 
300
382
  ``DELETE /api/integration/:integrationID/connect/oauth/:attemptID``
301
383
  """
302
- self._client.request(
303
- RequestOptions(
304
- method="DELETE",
305
- path=f"/api/integration/{encode_path_segment(integration_id)}/connect/oauth/{encode_path_segment(attempt_id)}",
306
- query={"location": self._location(location)},
307
- extra_headers=extra_headers,
308
- extra_query=extra_query,
309
- extra_body=extra_body,
310
- timeout=timeout,
384
+ return cast(
385
+ "None",
386
+ self._client.request(
387
+ RequestOptions(
388
+ method="DELETE",
389
+ path=f"/api/integration/{encode_path_segment(integration_id)}/connect/oauth/{encode_path_segment(attempt_id)}",
390
+ query={"location": self._location(location)},
391
+ extra_headers=extra_headers,
392
+ extra_query=extra_query,
393
+ extra_body=extra_body,
394
+ timeout=timeout,
395
+ ),
396
+ kind="void",
311
397
  ),
312
- kind="void",
313
398
  )
314
399
 
315
400
 
401
+ class IntegrationOauthResourceWithRawResponse:
402
+ """``client.integration.oauth.with_raw_response``."""
403
+
404
+ def __init__(self, resource: IntegrationOauthResource) -> None:
405
+ self._resource = resource
406
+ self.connect = to_raw_response_wrapper(resource.connect)
407
+ self.status = to_raw_response_wrapper(resource.status)
408
+ self.complete = to_raw_response_wrapper(resource.complete)
409
+ self.cancel = to_raw_response_wrapper(resource.cancel)
410
+
411
+
412
+ class IntegrationOauthResourceWithStreamingResponse:
413
+ """``client.integration.oauth.with_streaming_response``."""
414
+
415
+ def __init__(self, resource: IntegrationOauthResource) -> None:
416
+ self._resource = resource
417
+ self.connect = to_streamed_response_wrapper(resource.connect)
418
+ self.status = to_streamed_response_wrapper(resource.status)
419
+ self.complete = to_streamed_response_wrapper(resource.complete)
420
+ self.cancel = to_streamed_response_wrapper(resource.cancel)
421
+
422
+
316
423
  class IntegrationCommandResource(SyncAPIResource):
317
424
  """Operations under ``client.integration.command`` (OpenCode ``integration.command``)."""
318
425
 
426
+ @cached_property
427
+ def with_raw_response(self) -> IntegrationCommandResourceWithRawResponse:
428
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
429
+ return IntegrationCommandResourceWithRawResponse(self)
430
+
431
+ @cached_property
432
+ def with_streaming_response(self) -> IntegrationCommandResourceWithStreamingResponse:
433
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
434
+ return IntegrationCommandResourceWithStreamingResponse(self)
435
+
319
436
  def connect(
320
437
  self,
321
438
  integration_id: IntegrationID,
@@ -420,20 +537,43 @@ class IntegrationCommandResource(SyncAPIResource):
420
537
 
421
538
  ``DELETE /api/integration/:integrationID/connect/command/:attemptID``
422
539
  """
423
- self._client.request(
424
- RequestOptions(
425
- method="DELETE",
426
- path=f"/api/integration/{encode_path_segment(integration_id)}/connect/command/{encode_path_segment(attempt_id)}",
427
- query={"location": self._location(location)},
428
- extra_headers=extra_headers,
429
- extra_query=extra_query,
430
- extra_body=extra_body,
431
- timeout=timeout,
540
+ return cast(
541
+ "None",
542
+ self._client.request(
543
+ RequestOptions(
544
+ method="DELETE",
545
+ path=f"/api/integration/{encode_path_segment(integration_id)}/connect/command/{encode_path_segment(attempt_id)}",
546
+ query={"location": self._location(location)},
547
+ extra_headers=extra_headers,
548
+ extra_query=extra_query,
549
+ extra_body=extra_body,
550
+ timeout=timeout,
551
+ ),
552
+ kind="void",
432
553
  ),
433
- kind="void",
434
554
  )
435
555
 
436
556
 
557
+ class IntegrationCommandResourceWithRawResponse:
558
+ """``client.integration.command.with_raw_response``."""
559
+
560
+ def __init__(self, resource: IntegrationCommandResource) -> None:
561
+ self._resource = resource
562
+ self.connect = to_raw_response_wrapper(resource.connect)
563
+ self.status = to_raw_response_wrapper(resource.status)
564
+ self.cancel = to_raw_response_wrapper(resource.cancel)
565
+
566
+
567
+ class IntegrationCommandResourceWithStreamingResponse:
568
+ """``client.integration.command.with_streaming_response``."""
569
+
570
+ def __init__(self, resource: IntegrationCommandResource) -> None:
571
+ self._resource = resource
572
+ self.connect = to_streamed_response_wrapper(resource.connect)
573
+ self.status = to_streamed_response_wrapper(resource.status)
574
+ self.cancel = to_streamed_response_wrapper(resource.cancel)
575
+
576
+
437
577
  class IntegrationResource(SyncAPIResource):
438
578
  """Operations under ``client.integration`` (OpenCode ``integration``)."""
439
579
 
@@ -457,6 +597,16 @@ class IntegrationResource(SyncAPIResource):
457
597
  """Operations under ``client.integration.command``."""
458
598
  return IntegrationCommandResource(self._client)
459
599
 
600
+ @cached_property
601
+ def with_raw_response(self) -> IntegrationResourceWithRawResponse:
602
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
603
+ return IntegrationResourceWithRawResponse(self)
604
+
605
+ @cached_property
606
+ def with_streaming_response(self) -> IntegrationResourceWithStreamingResponse:
607
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
608
+ return IntegrationResourceWithStreamingResponse(self)
609
+
460
610
  def list(
461
611
  self,
462
612
  *,
@@ -532,9 +682,77 @@ class IntegrationResource(SyncAPIResource):
532
682
  )
533
683
 
534
684
 
685
+ class IntegrationResourceWithRawResponse:
686
+ """``client.integration.with_raw_response``."""
687
+
688
+ def __init__(self, resource: IntegrationResource) -> None:
689
+ self._resource = resource
690
+ self.list = to_raw_response_wrapper(resource.list)
691
+ self.get = to_raw_response_wrapper(resource.get)
692
+
693
+ @cached_property
694
+ def wellknown(self) -> IntegrationWellknownResourceWithRawResponse:
695
+ """``client.integration.wellknown.with_raw_response``."""
696
+ return IntegrationWellknownResourceWithRawResponse(self._resource.wellknown)
697
+
698
+ @cached_property
699
+ def connect(self) -> IntegrationConnectResourceWithRawResponse:
700
+ """``client.integration.connect.with_raw_response``."""
701
+ return IntegrationConnectResourceWithRawResponse(self._resource.connect)
702
+
703
+ @cached_property
704
+ def oauth(self) -> IntegrationOauthResourceWithRawResponse:
705
+ """``client.integration.oauth.with_raw_response``."""
706
+ return IntegrationOauthResourceWithRawResponse(self._resource.oauth)
707
+
708
+ @cached_property
709
+ def command(self) -> IntegrationCommandResourceWithRawResponse:
710
+ """``client.integration.command.with_raw_response``."""
711
+ return IntegrationCommandResourceWithRawResponse(self._resource.command)
712
+
713
+
714
+ class IntegrationResourceWithStreamingResponse:
715
+ """``client.integration.with_streaming_response``."""
716
+
717
+ def __init__(self, resource: IntegrationResource) -> None:
718
+ self._resource = resource
719
+ self.list = to_streamed_response_wrapper(resource.list)
720
+ self.get = to_streamed_response_wrapper(resource.get)
721
+
722
+ @cached_property
723
+ def wellknown(self) -> IntegrationWellknownResourceWithStreamingResponse:
724
+ """``client.integration.wellknown.with_streaming_response``."""
725
+ return IntegrationWellknownResourceWithStreamingResponse(self._resource.wellknown)
726
+
727
+ @cached_property
728
+ def connect(self) -> IntegrationConnectResourceWithStreamingResponse:
729
+ """``client.integration.connect.with_streaming_response``."""
730
+ return IntegrationConnectResourceWithStreamingResponse(self._resource.connect)
731
+
732
+ @cached_property
733
+ def oauth(self) -> IntegrationOauthResourceWithStreamingResponse:
734
+ """``client.integration.oauth.with_streaming_response``."""
735
+ return IntegrationOauthResourceWithStreamingResponse(self._resource.oauth)
736
+
737
+ @cached_property
738
+ def command(self) -> IntegrationCommandResourceWithStreamingResponse:
739
+ """``client.integration.command.with_streaming_response``."""
740
+ return IntegrationCommandResourceWithStreamingResponse(self._resource.command)
741
+
742
+
535
743
  class AsyncIntegrationWellknownResource(AsyncAPIResource):
536
744
  """Operations under ``client.integration.wellknown`` (OpenCode ``integration.wellknown``)."""
537
745
 
746
+ @cached_property
747
+ def with_raw_response(self) -> AsyncIntegrationWellknownResourceWithRawResponse:
748
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
749
+ return AsyncIntegrationWellknownResourceWithRawResponse(self)
750
+
751
+ @cached_property
752
+ def with_streaming_response(self) -> AsyncIntegrationWellknownResourceWithStreamingResponse:
753
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
754
+ return AsyncIntegrationWellknownResourceWithStreamingResponse(self)
755
+
538
756
  async def add(
539
757
  self,
540
758
  *,
@@ -558,24 +776,53 @@ class AsyncIntegrationWellknownResource(AsyncAPIResource):
558
776
 
559
777
  ``POST /api/experimental/integration/wellknown``
560
778
  """
561
- await self._client.request(
562
- RequestOptions(
563
- method="POST",
564
- path="/api/experimental/integration/wellknown",
565
- query={"location": self._location(location)},
566
- body={"url": url},
567
- extra_headers=extra_headers,
568
- extra_query=extra_query,
569
- extra_body=extra_body,
570
- timeout=timeout,
779
+ return cast(
780
+ "None",
781
+ await self._client.request(
782
+ RequestOptions(
783
+ method="POST",
784
+ path="/api/experimental/integration/wellknown",
785
+ query={"location": self._location(location)},
786
+ body={"url": url},
787
+ extra_headers=extra_headers,
788
+ extra_query=extra_query,
789
+ extra_body=extra_body,
790
+ timeout=timeout,
791
+ ),
792
+ kind="void",
571
793
  ),
572
- kind="void",
573
794
  )
574
795
 
575
796
 
797
+ class AsyncIntegrationWellknownResourceWithRawResponse:
798
+ """``client.integration.wellknown.with_raw_response``."""
799
+
800
+ def __init__(self, resource: AsyncIntegrationWellknownResource) -> None:
801
+ self._resource = resource
802
+ self.add = async_to_raw_response_wrapper(resource.add)
803
+
804
+
805
+ class AsyncIntegrationWellknownResourceWithStreamingResponse:
806
+ """``client.integration.wellknown.with_streaming_response``."""
807
+
808
+ def __init__(self, resource: AsyncIntegrationWellknownResource) -> None:
809
+ self._resource = resource
810
+ self.add = async_to_streamed_response_wrapper(resource.add)
811
+
812
+
576
813
  class AsyncIntegrationConnectResource(AsyncAPIResource):
577
814
  """Operations under ``client.integration.connect`` (OpenCode ``integration.connect``)."""
578
815
 
816
+ @cached_property
817
+ def with_raw_response(self) -> AsyncIntegrationConnectResourceWithRawResponse:
818
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
819
+ return AsyncIntegrationConnectResourceWithRawResponse(self)
820
+
821
+ @cached_property
822
+ def with_streaming_response(self) -> AsyncIntegrationConnectResourceWithStreamingResponse:
823
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
824
+ return AsyncIntegrationConnectResourceWithStreamingResponse(self)
825
+
579
826
  async def key(
580
827
  self,
581
828
  integration_id: IntegrationID,
@@ -601,18 +848,21 @@ class AsyncIntegrationConnectResource(AsyncAPIResource):
601
848
 
602
849
  ``POST /api/integration/:integrationID/connect/key``
603
850
  """
604
- await self._client.request(
605
- RequestOptions(
606
- method="POST",
607
- path=f"/api/integration/{encode_path_segment(integration_id)}/connect/key",
608
- query={"location": self._location(location)},
609
- body={"key": key, "answer": answer, "label": label},
610
- extra_headers=extra_headers,
611
- extra_query=extra_query,
612
- extra_body=extra_body,
613
- timeout=timeout,
851
+ return cast(
852
+ "None",
853
+ await self._client.request(
854
+ RequestOptions(
855
+ method="POST",
856
+ path=f"/api/integration/{encode_path_segment(integration_id)}/connect/key",
857
+ query={"location": self._location(location)},
858
+ body={"key": key, "answer": answer, "label": label},
859
+ extra_headers=extra_headers,
860
+ extra_query=extra_query,
861
+ extra_body=extra_body,
862
+ timeout=timeout,
863
+ ),
864
+ kind="void",
614
865
  ),
615
- kind="void",
616
866
  )
617
867
 
618
868
  async def external(
@@ -640,24 +890,55 @@ class AsyncIntegrationConnectResource(AsyncAPIResource):
640
890
 
641
891
  ``POST /api/integration/:integrationID/connect/external``
642
892
  """
643
- await self._client.request(
644
- RequestOptions(
645
- method="POST",
646
- path=f"/api/integration/{encode_path_segment(integration_id)}/connect/external",
647
- query={"location": self._location(location)},
648
- body={"methodID": method_id, "answer": answer, "label": label},
649
- extra_headers=extra_headers,
650
- extra_query=extra_query,
651
- extra_body=extra_body,
652
- timeout=timeout,
893
+ return cast(
894
+ "None",
895
+ await self._client.request(
896
+ RequestOptions(
897
+ method="POST",
898
+ path=f"/api/integration/{encode_path_segment(integration_id)}/connect/external",
899
+ query={"location": self._location(location)},
900
+ body={"methodID": method_id, "answer": answer, "label": label},
901
+ extra_headers=extra_headers,
902
+ extra_query=extra_query,
903
+ extra_body=extra_body,
904
+ timeout=timeout,
905
+ ),
906
+ kind="void",
653
907
  ),
654
- kind="void",
655
908
  )
656
909
 
657
910
 
911
+ class AsyncIntegrationConnectResourceWithRawResponse:
912
+ """``client.integration.connect.with_raw_response``."""
913
+
914
+ def __init__(self, resource: AsyncIntegrationConnectResource) -> None:
915
+ self._resource = resource
916
+ self.key = async_to_raw_response_wrapper(resource.key)
917
+ self.external = async_to_raw_response_wrapper(resource.external)
918
+
919
+
920
+ class AsyncIntegrationConnectResourceWithStreamingResponse:
921
+ """``client.integration.connect.with_streaming_response``."""
922
+
923
+ def __init__(self, resource: AsyncIntegrationConnectResource) -> None:
924
+ self._resource = resource
925
+ self.key = async_to_streamed_response_wrapper(resource.key)
926
+ self.external = async_to_streamed_response_wrapper(resource.external)
927
+
928
+
658
929
  class AsyncIntegrationOauthResource(AsyncAPIResource):
659
930
  """Operations under ``client.integration.oauth`` (OpenCode ``integration.oauth``)."""
660
931
 
932
+ @cached_property
933
+ def with_raw_response(self) -> AsyncIntegrationOauthResourceWithRawResponse:
934
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
935
+ return AsyncIntegrationOauthResourceWithRawResponse(self)
936
+
937
+ @cached_property
938
+ def with_streaming_response(self) -> AsyncIntegrationOauthResourceWithStreamingResponse:
939
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
940
+ return AsyncIntegrationOauthResourceWithStreamingResponse(self)
941
+
661
942
  async def connect(
662
943
  self,
663
944
  integration_id: IntegrationID,
@@ -764,18 +1045,21 @@ class AsyncIntegrationOauthResource(AsyncAPIResource):
764
1045
 
765
1046
  ``POST /api/integration/:integrationID/connect/oauth/:attemptID/complete``
766
1047
  """
767
- await self._client.request(
768
- RequestOptions(
769
- method="POST",
770
- path=f"/api/integration/{encode_path_segment(integration_id)}/connect/oauth/{encode_path_segment(attempt_id)}/complete",
771
- query={"location": self._location(location)},
772
- body={"code": code},
773
- extra_headers=extra_headers,
774
- extra_query=extra_query,
775
- extra_body=extra_body,
776
- timeout=timeout,
1048
+ return cast(
1049
+ "None",
1050
+ await self._client.request(
1051
+ RequestOptions(
1052
+ method="POST",
1053
+ path=f"/api/integration/{encode_path_segment(integration_id)}/connect/oauth/{encode_path_segment(attempt_id)}/complete",
1054
+ query={"location": self._location(location)},
1055
+ body={"code": code},
1056
+ extra_headers=extra_headers,
1057
+ extra_query=extra_query,
1058
+ extra_body=extra_body,
1059
+ timeout=timeout,
1060
+ ),
1061
+ kind="void",
777
1062
  ),
778
- kind="void",
779
1063
  )
780
1064
 
781
1065
  async def cancel(
@@ -800,23 +1084,58 @@ class AsyncIntegrationOauthResource(AsyncAPIResource):
800
1084
 
801
1085
  ``DELETE /api/integration/:integrationID/connect/oauth/:attemptID``
802
1086
  """
803
- await self._client.request(
804
- RequestOptions(
805
- method="DELETE",
806
- path=f"/api/integration/{encode_path_segment(integration_id)}/connect/oauth/{encode_path_segment(attempt_id)}",
807
- query={"location": self._location(location)},
808
- extra_headers=extra_headers,
809
- extra_query=extra_query,
810
- extra_body=extra_body,
811
- timeout=timeout,
1087
+ return cast(
1088
+ "None",
1089
+ await self._client.request(
1090
+ RequestOptions(
1091
+ method="DELETE",
1092
+ path=f"/api/integration/{encode_path_segment(integration_id)}/connect/oauth/{encode_path_segment(attempt_id)}",
1093
+ query={"location": self._location(location)},
1094
+ extra_headers=extra_headers,
1095
+ extra_query=extra_query,
1096
+ extra_body=extra_body,
1097
+ timeout=timeout,
1098
+ ),
1099
+ kind="void",
812
1100
  ),
813
- kind="void",
814
1101
  )
815
1102
 
816
1103
 
1104
+ class AsyncIntegrationOauthResourceWithRawResponse:
1105
+ """``client.integration.oauth.with_raw_response``."""
1106
+
1107
+ def __init__(self, resource: AsyncIntegrationOauthResource) -> None:
1108
+ self._resource = resource
1109
+ self.connect = async_to_raw_response_wrapper(resource.connect)
1110
+ self.status = async_to_raw_response_wrapper(resource.status)
1111
+ self.complete = async_to_raw_response_wrapper(resource.complete)
1112
+ self.cancel = async_to_raw_response_wrapper(resource.cancel)
1113
+
1114
+
1115
+ class AsyncIntegrationOauthResourceWithStreamingResponse:
1116
+ """``client.integration.oauth.with_streaming_response``."""
1117
+
1118
+ def __init__(self, resource: AsyncIntegrationOauthResource) -> None:
1119
+ self._resource = resource
1120
+ self.connect = async_to_streamed_response_wrapper(resource.connect)
1121
+ self.status = async_to_streamed_response_wrapper(resource.status)
1122
+ self.complete = async_to_streamed_response_wrapper(resource.complete)
1123
+ self.cancel = async_to_streamed_response_wrapper(resource.cancel)
1124
+
1125
+
817
1126
  class AsyncIntegrationCommandResource(AsyncAPIResource):
818
1127
  """Operations under ``client.integration.command`` (OpenCode ``integration.command``)."""
819
1128
 
1129
+ @cached_property
1130
+ def with_raw_response(self) -> AsyncIntegrationCommandResourceWithRawResponse:
1131
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
1132
+ return AsyncIntegrationCommandResourceWithRawResponse(self)
1133
+
1134
+ @cached_property
1135
+ def with_streaming_response(self) -> AsyncIntegrationCommandResourceWithStreamingResponse:
1136
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
1137
+ return AsyncIntegrationCommandResourceWithStreamingResponse(self)
1138
+
820
1139
  async def connect(
821
1140
  self,
822
1141
  integration_id: IntegrationID,
@@ -921,20 +1240,43 @@ class AsyncIntegrationCommandResource(AsyncAPIResource):
921
1240
 
922
1241
  ``DELETE /api/integration/:integrationID/connect/command/:attemptID``
923
1242
  """
924
- await self._client.request(
925
- RequestOptions(
926
- method="DELETE",
927
- path=f"/api/integration/{encode_path_segment(integration_id)}/connect/command/{encode_path_segment(attempt_id)}",
928
- query={"location": self._location(location)},
929
- extra_headers=extra_headers,
930
- extra_query=extra_query,
931
- extra_body=extra_body,
932
- timeout=timeout,
1243
+ return cast(
1244
+ "None",
1245
+ await self._client.request(
1246
+ RequestOptions(
1247
+ method="DELETE",
1248
+ path=f"/api/integration/{encode_path_segment(integration_id)}/connect/command/{encode_path_segment(attempt_id)}",
1249
+ query={"location": self._location(location)},
1250
+ extra_headers=extra_headers,
1251
+ extra_query=extra_query,
1252
+ extra_body=extra_body,
1253
+ timeout=timeout,
1254
+ ),
1255
+ kind="void",
933
1256
  ),
934
- kind="void",
935
1257
  )
936
1258
 
937
1259
 
1260
+ class AsyncIntegrationCommandResourceWithRawResponse:
1261
+ """``client.integration.command.with_raw_response``."""
1262
+
1263
+ def __init__(self, resource: AsyncIntegrationCommandResource) -> None:
1264
+ self._resource = resource
1265
+ self.connect = async_to_raw_response_wrapper(resource.connect)
1266
+ self.status = async_to_raw_response_wrapper(resource.status)
1267
+ self.cancel = async_to_raw_response_wrapper(resource.cancel)
1268
+
1269
+
1270
+ class AsyncIntegrationCommandResourceWithStreamingResponse:
1271
+ """``client.integration.command.with_streaming_response``."""
1272
+
1273
+ def __init__(self, resource: AsyncIntegrationCommandResource) -> None:
1274
+ self._resource = resource
1275
+ self.connect = async_to_streamed_response_wrapper(resource.connect)
1276
+ self.status = async_to_streamed_response_wrapper(resource.status)
1277
+ self.cancel = async_to_streamed_response_wrapper(resource.cancel)
1278
+
1279
+
938
1280
  class AsyncIntegrationResource(AsyncAPIResource):
939
1281
  """Operations under ``client.integration`` (OpenCode ``integration``)."""
940
1282
 
@@ -958,6 +1300,16 @@ class AsyncIntegrationResource(AsyncAPIResource):
958
1300
  """Operations under ``client.integration.command``."""
959
1301
  return AsyncIntegrationCommandResource(self._client)
960
1302
 
1303
+ @cached_property
1304
+ def with_raw_response(self) -> AsyncIntegrationResourceWithRawResponse:
1305
+ """Same methods, returning the raw HTTP response; call ``.parse()`` on it for the usual value."""
1306
+ return AsyncIntegrationResourceWithRawResponse(self)
1307
+
1308
+ @cached_property
1309
+ def with_streaming_response(self) -> AsyncIntegrationResourceWithStreamingResponse:
1310
+ """Same methods, returning a context manager over the HTTP response without reading the body."""
1311
+ return AsyncIntegrationResourceWithStreamingResponse(self)
1312
+
961
1313
  async def list(
962
1314
  self,
963
1315
  *,
@@ -1031,3 +1383,61 @@ class AsyncIntegrationResource(AsyncAPIResource):
1031
1383
  response_type="IntegrationGetResponse",
1032
1384
  ),
1033
1385
  )
1386
+
1387
+
1388
+ class AsyncIntegrationResourceWithRawResponse:
1389
+ """``client.integration.with_raw_response``."""
1390
+
1391
+ def __init__(self, resource: AsyncIntegrationResource) -> None:
1392
+ self._resource = resource
1393
+ self.list = async_to_raw_response_wrapper(resource.list)
1394
+ self.get = async_to_raw_response_wrapper(resource.get)
1395
+
1396
+ @cached_property
1397
+ def wellknown(self) -> AsyncIntegrationWellknownResourceWithRawResponse:
1398
+ """``client.integration.wellknown.with_raw_response``."""
1399
+ return AsyncIntegrationWellknownResourceWithRawResponse(self._resource.wellknown)
1400
+
1401
+ @cached_property
1402
+ def connect(self) -> AsyncIntegrationConnectResourceWithRawResponse:
1403
+ """``client.integration.connect.with_raw_response``."""
1404
+ return AsyncIntegrationConnectResourceWithRawResponse(self._resource.connect)
1405
+
1406
+ @cached_property
1407
+ def oauth(self) -> AsyncIntegrationOauthResourceWithRawResponse:
1408
+ """``client.integration.oauth.with_raw_response``."""
1409
+ return AsyncIntegrationOauthResourceWithRawResponse(self._resource.oauth)
1410
+
1411
+ @cached_property
1412
+ def command(self) -> AsyncIntegrationCommandResourceWithRawResponse:
1413
+ """``client.integration.command.with_raw_response``."""
1414
+ return AsyncIntegrationCommandResourceWithRawResponse(self._resource.command)
1415
+
1416
+
1417
+ class AsyncIntegrationResourceWithStreamingResponse:
1418
+ """``client.integration.with_streaming_response``."""
1419
+
1420
+ def __init__(self, resource: AsyncIntegrationResource) -> None:
1421
+ self._resource = resource
1422
+ self.list = async_to_streamed_response_wrapper(resource.list)
1423
+ self.get = async_to_streamed_response_wrapper(resource.get)
1424
+
1425
+ @cached_property
1426
+ def wellknown(self) -> AsyncIntegrationWellknownResourceWithStreamingResponse:
1427
+ """``client.integration.wellknown.with_streaming_response``."""
1428
+ return AsyncIntegrationWellknownResourceWithStreamingResponse(self._resource.wellknown)
1429
+
1430
+ @cached_property
1431
+ def connect(self) -> AsyncIntegrationConnectResourceWithStreamingResponse:
1432
+ """``client.integration.connect.with_streaming_response``."""
1433
+ return AsyncIntegrationConnectResourceWithStreamingResponse(self._resource.connect)
1434
+
1435
+ @cached_property
1436
+ def oauth(self) -> AsyncIntegrationOauthResourceWithStreamingResponse:
1437
+ """``client.integration.oauth.with_streaming_response``."""
1438
+ return AsyncIntegrationOauthResourceWithStreamingResponse(self._resource.oauth)
1439
+
1440
+ @cached_property
1441
+ def command(self) -> AsyncIntegrationCommandResourceWithStreamingResponse:
1442
+ """``client.integration.command.with_streaming_response``."""
1443
+ return AsyncIntegrationCommandResourceWithStreamingResponse(self._resource.command)