summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-02-28 13:53:54 +0100
committerGitHub <noreply@github.com>2021-02-28 13:53:54 +0100
commitf5a65f0580dedf127243fc3dd42f39c4d704eae1 (patch)
tree03a55f28876ef63d1edb0354db86ccf4ba930e29
parent74414552bd054b32016a7a9e010b13cd8a4f33d9 (diff)
parent88372074a703910ba533237e6901e5af4c26c2bd (diff)
downloadgitlab-f5a65f0580dedf127243fc3dd42f39c4d704eae1.tar.gz
Merge pull request #1343 from JohnVillalovos/jlvillal/mypy_testing_things
chore: add and fix some type-hints in gitlab/client.py
-rw-r--r--gitlab/client.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/gitlab/client.py b/gitlab/client.py
index dfe7a41..d40f58a 100644
--- a/gitlab/client.py
+++ b/gitlab/client.py
@@ -623,7 +623,7 @@ class Gitlab(object):
query_data: Optional[Dict[str, Any]] = None,
as_list=None,
**kwargs,
- ):
+ ) -> Union["GitlabList", List[Dict[str, Any]]]:
"""Make a GET request to the Gitlab server for list-oriented queries.
Args:
@@ -772,7 +772,9 @@ class Gitlab(object):
return self.http_request("delete", path, **kwargs)
@gitlab.exceptions.on_http_error(gitlab.exceptions.GitlabSearchError)
- def search(self, scope: str, search: str, **kwargs) -> requests.Response:
+ def search(
+ self, scope: str, search: str, **kwargs
+ ) -> Union["GitlabList", List[Dict[str, Any]]]:
"""Search GitLab resources matching the provided string.'
Args:
@@ -896,10 +898,10 @@ class GitlabList(object):
return 0
return int(self._total)
- def __next__(self):
+ def __next__(self) -> Dict[str, Any]:
return self.next()
- def next(self) -> "Gitlab":
+ def next(self) -> Dict[str, Any]:
try:
item = self._data[self._current]
self._current += 1