@@ -119,10 +119,10 @@ def __init__(
119119raise ModuleNotFoundError (f"gitlab.v{ self ._api_version } .objects" )
120120# NOTE: We must delay import of gitlab.v4.objects until now or
121121# otherwise it will cause circular import errors
122- import gitlab .v4 . objects
122+ from gitlab .v4 import objects
123123
124- objects = gitlab .v4 .objects
125124self ._objects = objects
125+ self .user :Optional [objects .CurrentUser ]= None
126126
127127self .broadcastmessages = objects .BroadcastMessageManager (self )
128128"""See :class:`~gitlab.v4.objects.BroadcastMessageManager`"""
@@ -213,9 +213,9 @@ def __setstate__(self, state: Dict[str, Any]) -> None:
213213 )# pragma: no cover, dead code currently
214214# NOTE: We must delay import of gitlab.v4.objects until now or
215215# otherwise it will cause circular import errors
216- import gitlab .v4 . objects
216+ from gitlab .v4 import objects
217217
218- self ._objects = gitlab . v4 . objects
218+ self ._objects = objects
219219
220220@property
221221def url (self )-> str :
@@ -514,7 +514,8 @@ def _set_auth_info(self) -> None:
514514self .http_username ,self .http_password
515515 )
516516
517- def enable_debug (self )-> None :
517+ @staticmethod
518+ def enable_debug ()-> None :
518519import logging
519520from http .client import HTTPConnection # noqa
520521
@@ -533,7 +534,8 @@ def _get_session_opts(self) -> Dict[str, Any]:
533534"verify" :self .ssl_verify ,
534535 }
535536
536- def _get_base_url (self ,url :Optional [str ]= None )-> str :
537+ @staticmethod
538+ def _get_base_url (url :Optional [str ]= None )-> str :
537539"""Return the base URL with the trailing slash stripped.
538540 If the URL is a Falsy value, return the default URL.
539541 Returns:
@@ -555,10 +557,10 @@ def _build_url(self, path: str) -> str:
555557 """
556558if path .startswith ("http://" )or path .startswith ("https://" ):
557559return path
558- else :
559- return f"{ self ._url } { path } "
560+ return f"{ self ._url } { path } "
560561
561- def _check_redirects (self ,result :requests .Response )-> None :
562+ @staticmethod
563+ def _check_redirects (result :requests .Response )-> None :
562564# Check the requests history to detect 301/302 redirections.
563565# If the initial verb is POST or PUT, the redirected request will use a
564566# GET request, leading to unwanted behaviour.
@@ -583,8 +585,8 @@ def _check_redirects(self, result: requests.Response) -> None:
583585 )
584586 )
585587
588+ @staticmethod
586589def _prepare_send_data (
587- self ,
588590files :Optional [Dict [str ,Any ]]= None ,
589591post_data :Optional [Union [Dict [str ,Any ],bytes ]]= None ,
590592raw :bool = False ,