1+ from typing import Any , cast , Dict , List , Optional , Union
2+
13from gitlab import cli
24from gitlab .base import RESTManager , RESTObject
35from gitlab .mixins import (
@@ -253,7 +255,9 @@ class ProjectServiceManager(GetMixin, UpdateMixin, DeleteMixin, ListMixin, RESTM
253255 "youtrack" : (("issues_url" , "project_url" ), ("description" , "push_events" )),
254256 }
255257
256- def get (self , id , ** kwargs ):
258+ def get (
259+ self , id : Union [str , int ], lazy : bool = False , ** kwargs : Any
260+ ) -> ProjectService :
257261 """Retrieve a single object.
258262
259263 Args:
@@ -270,11 +274,16 @@ def get(self, id, **kwargs):
270274 GitlabAuthenticationError: If authentication is not correct
271275 GitlabGetError: If the server cannot perform the request
272276 """
273- obj = super (ProjectServiceManager , self ).get (id , ** kwargs )
277+ obj = cast ( ProjectService , super (ProjectServiceManager , self ).get (id , ** kwargs ) )
274278 obj .id = id
275279 return obj
276280
277- def update (self , id = None , new_data = None , ** kwargs ):
281+ def update (
282+ self ,
283+ id : Optional [Union [str , int ]] = None ,
284+ new_data : Optional [Dict [str , Any ]] = None ,
285+ ** kwargs : Any
286+ ) -> Dict [str , Any ]:
278287 """Update an object on the server.
279288
280289 Args:
@@ -290,11 +299,12 @@ def update(self, id=None, new_data=None, **kwargs):
290299 GitlabUpdateError: If the server cannot perform the request
291300 """
292301 new_data = new_data or {}
293- super (ProjectServiceManager , self ).update (id , new_data , ** kwargs )
302+ result = super (ProjectServiceManager , self ).update (id , new_data , ** kwargs )
294303 self .id = id
304+ return result
295305
296306 @cli .register_custom_action ("ProjectServiceManager" )
297- def available (self , ** kwargs ) :
307+ def available (self , ** kwargs : Any ) -> List [ str ] :
298308 """List the services known by python-gitlab.
299309
300310 Returns:
0 commit comments