8
8
from typing import Any , Optional , Union
9
9
from collections .abc import Iterator
10
10
11
- from requests import Response
11
+ from podman . api . client import APIResponse
12
12
from .output_utils import demux_output
13
13
14
14
@@ -67,7 +67,7 @@ def prepare_cidr(value: Union[ipaddress.IPv4Network, ipaddress.IPv6Network]) ->
67
67
return str (value .network_address ), base64 .b64encode (value .netmask .packed ).decode ("utf-8" )
68
68
69
69
70
- def frames (response : Response ) -> Iterator [bytes ]:
70
+ def frames (response : APIResponse ) -> Iterator [bytes ]:
71
71
"""Returns each frame from multiplexed payload, all results are expected in the payload.
72
72
73
73
The stdout and stderr frames are undifferentiated as they are returned.
@@ -84,7 +84,7 @@ def frames(response: Response) -> Iterator[bytes]:
84
84
85
85
86
86
def stream_frames (
87
- response : Response , demux : bool = False
87
+ response : APIResponse , demux : bool = False
88
88
) -> Iterator [Union [bytes , tuple [bytes , bytes ]]]:
89
89
"""Returns each frame from multiplexed streamed payload.
90
90
@@ -111,7 +111,7 @@ def stream_frames(
111
111
112
112
113
113
def stream_helper (
114
- response : Response , decode_to_json : bool = False
114
+ response : APIResponse , decode_to_json : bool = False
115
115
) -> Union [Iterator [bytes ], Iterator [dict [str , Any ]]]:
116
116
"""Helper to stream results and optionally decode to json"""
117
117
for value in response .iter_lines ():
0 commit comments