diff options
author | Nejc Habjan <nejc.habjan@siemens.com> | 2023-02-12 12:30:29 +0100 |
---|---|---|
committer | Nejc Habjan <nejc.habjan@siemens.com> | 2023-03-12 09:39:54 +0100 |
commit | ab089fbf04d8946a4748723dfd3029a943a43b2f (patch) | |
tree | 26a7d0c534abfbeffbe54808ffa3e755db85479e /gitlab/_backends/protocol.py | |
parent | 07d03dc959128e05d21e8dfd79aa8e916ab5b150 (diff) | |
download | gitlab-refactor/response-content-backend.tar.gz |
refactor: move response_content into backend coderefactor/response-content-backend
Diffstat (limited to 'gitlab/_backends/protocol.py')
-rw-r--r-- | gitlab/_backends/protocol.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gitlab/_backends/protocol.py b/gitlab/_backends/protocol.py index f89740b..3f8af3d 100644 --- a/gitlab/_backends/protocol.py +++ b/gitlab/_backends/protocol.py @@ -1,6 +1,6 @@ import abc import sys -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Iterator, Optional, Union import requests from requests_toolbelt.multipart.encoder import MultipartEncoder # type: ignore @@ -18,6 +18,18 @@ class BackendResponse(Protocol): class Backend(Protocol): + @staticmethod + @abc.abstractmethod + def response_content( + response: requests.Response, + streamed: bool, + action: Optional[Callable[[bytes], None]], + chunk_size: int, + *, + iterator: bool, + ) -> Optional[Union[bytes, Iterator[Any]]]: + ... + @abc.abstractmethod def http_request( self, |