24
24
async_to_streamed_response_wrapper ,
25
25
)
26
26
from .._base_client import make_request_options
27
+ from .._decoders .jsonl import JSONLDecoder , AsyncJSONLDecoder
27
28
from ..types .event_list_response import EventListResponse
28
29
from ..types .event_watch_response import EventWatchResponse
29
30
@@ -136,7 +137,7 @@ def watch(
136
137
extra_query : Query | None = None ,
137
138
extra_body : Body | None = None ,
138
139
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
139
- ) -> EventWatchResponse :
140
+ ) -> JSONLDecoder [ EventWatchResponse ] :
140
141
"""
141
142
WatchEvents streams all requests events to the client
142
143
@@ -173,7 +174,7 @@ def watch(
173
174
extra_query : Query | None = None ,
174
175
extra_body : Body | None = None ,
175
176
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
176
- ) -> EventWatchResponse :
177
+ ) -> JSONLDecoder [ EventWatchResponse ] :
177
178
"""
178
179
WatchEvents streams all requests events to the client
179
180
@@ -211,8 +212,8 @@ def watch(
211
212
extra_query : Query | None = None ,
212
213
extra_body : Body | None = None ,
213
214
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
214
- ) -> EventWatchResponse :
215
- extra_headers = {"Accept" : "application/connect+json " , ** (extra_headers or {})}
215
+ ) -> JSONLDecoder [ EventWatchResponse ] :
216
+ extra_headers = {"Accept" : "application/jsonl " , ** (extra_headers or {})}
216
217
extra_headers = {
217
218
** strip_not_given (
218
219
{
@@ -234,7 +235,8 @@ def watch(
234
235
options = make_request_options (
235
236
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
236
237
),
237
- cast_to = EventWatchResponse ,
238
+ cast_to = JSONLDecoder [EventWatchResponse ],
239
+ stream = True ,
238
240
)
239
241
240
242
@@ -344,7 +346,7 @@ async def watch(
344
346
extra_query : Query | None = None ,
345
347
extra_body : Body | None = None ,
346
348
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
347
- ) -> EventWatchResponse :
349
+ ) -> AsyncJSONLDecoder [ EventWatchResponse ] :
348
350
"""
349
351
WatchEvents streams all requests events to the client
350
352
@@ -381,7 +383,7 @@ async def watch(
381
383
extra_query : Query | None = None ,
382
384
extra_body : Body | None = None ,
383
385
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
384
- ) -> EventWatchResponse :
386
+ ) -> AsyncJSONLDecoder [ EventWatchResponse ] :
385
387
"""
386
388
WatchEvents streams all requests events to the client
387
389
@@ -419,8 +421,8 @@ async def watch(
419
421
extra_query : Query | None = None ,
420
422
extra_body : Body | None = None ,
421
423
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
422
- ) -> EventWatchResponse :
423
- extra_headers = {"Accept" : "application/connect+json " , ** (extra_headers or {})}
424
+ ) -> AsyncJSONLDecoder [ EventWatchResponse ] :
425
+ extra_headers = {"Accept" : "application/jsonl " , ** (extra_headers or {})}
424
426
extra_headers = {
425
427
** strip_not_given (
426
428
{
@@ -442,7 +444,8 @@ async def watch(
442
444
options = make_request_options (
443
445
extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
444
446
),
445
- cast_to = EventWatchResponse ,
447
+ cast_to = AsyncJSONLDecoder [EventWatchResponse ],
448
+ stream = True ,
446
449
)
447
450
448
451
0 commit comments