1- from typing import Any , cast , Dict , Optional , Tuple , TYPE_CHECKING , Union
1+ from typing import Any , cast , Dict , List , Optional , Tuple , TYPE_CHECKING , Union
22
3- from gitlab import cli
3+ import requests
4+
5+ from gitlab import cli , client
46from gitlab import exceptions as exc
57from gitlab import types
68from gitlab .base import RESTManager , RESTObject
@@ -182,7 +184,9 @@ def reorder(
182184
183185 @cli .register_custom_action (cls_names = "ProjectIssue" )
184186 @exc .on_http_error (exc .GitlabGetError )
185- def related_merge_requests (self , ** kwargs : Any ) -> Dict [str , Any ]:
187+ def related_merge_requests (
188+ self , ** kwargs : Any
189+ ) -> Union [client .GitlabList , List [Dict [str , Any ]]]:
186190 """List merge requests related to the issue.
187191
188192 Args:
@@ -196,14 +200,16 @@ def related_merge_requests(self, **kwargs: Any) -> Dict[str, Any]:
196200 The list of merge requests.
197201 """
198202 path = f"{ self .manager .path } /{ self .encoded_id } /related_merge_requests"
199- result = self .manager .gitlab .http_get (path , ** kwargs )
203+ result = self .manager .gitlab .http_list (path , ** kwargs )
200204 if TYPE_CHECKING :
201- assert isinstance (result , dict )
205+ assert not isinstance (result , requests . Response )
202206 return result
203207
204208 @cli .register_custom_action (cls_names = "ProjectIssue" )
205209 @exc .on_http_error (exc .GitlabGetError )
206- def closed_by (self , ** kwargs : Any ) -> Dict [str , Any ]:
210+ def closed_by (
211+ self , ** kwargs : Any
212+ ) -> Union [client .GitlabList , List [Dict [str , Any ]]]:
207213 """List merge requests that will close the issue when merged.
208214
209215 Args:
@@ -217,9 +223,9 @@ def closed_by(self, **kwargs: Any) -> Dict[str, Any]:
217223 The list of merge requests.
218224 """
219225 path = f"{ self .manager .path } /{ self .encoded_id } /closed_by"
220- result = self .manager .gitlab .http_get (path , ** kwargs )
226+ result = self .manager .gitlab .http_list (path , ** kwargs )
221227 if TYPE_CHECKING :
222- assert isinstance (result , dict )
228+ assert not isinstance (result , requests . Response )
223229 return result
224230
225231
0 commit comments