@@ -101,7 +101,7 @@ def get(
101101 """
102102 if not isinstance (id , int ):
103103 id = utils .clean_str_id (id )
104- path = "%s/%s" % ( self .path , id )
104+ path = f" { self .path } / { id } "
105105 if TYPE_CHECKING :
106106 assert self ._obj_cls is not None
107107 if lazy is True :
@@ -173,7 +173,7 @@ def refresh(self, **kwargs: Any) -> None:
173173 GitlabGetError: If the server cannot perform the request
174174 """
175175 if self ._id_attr :
176- path = "%s/%s" % ( self .manager .path , self .id )
176+ path = f" { self .manager .path } / { self .id } "
177177 else :
178178 if TYPE_CHECKING :
179179 assert self .manager .path is not None
@@ -273,7 +273,7 @@ def _check_missing_create_attrs(self, data: Dict[str, Any]) -> None:
273273 missing .append (attr )
274274 continue
275275 if missing :
276- raise AttributeError ("Missing attributes: %s" % ", " .join (missing ))
276+ raise AttributeError (f "Missing attributes: { ', ' .join (missing )} " )
277277
278278 @exc .on_http_error (exc .GitlabCreateError )
279279 def create (
@@ -349,7 +349,7 @@ def _check_missing_update_attrs(self, data: Dict[str, Any]) -> None:
349349 missing .append (attr )
350350 continue
351351 if missing :
352- raise AttributeError ("Missing attributes: %s" % ", " .join (missing ))
352+ raise AttributeError (f "Missing attributes: { ', ' .join (missing )} " )
353353
354354 def _get_update_method (
355355 self ,
@@ -370,7 +370,7 @@ def update(
370370 self ,
371371 id : Optional [Union [str , int ]] = None ,
372372 new_data : Optional [Dict [str , Any ]] = None ,
373- ** kwargs : Any
373+ ** kwargs : Any ,
374374 ) -> Dict [str , Any ]:
375375 """Update an object on the server.
376376
@@ -391,7 +391,7 @@ def update(
391391 if id is None :
392392 path = self .path
393393 else :
394- path = "%s/%s" % ( self .path , id )
394+ path = f" { self .path } / { id } "
395395
396396 self ._check_missing_update_attrs (new_data )
397397 files = {}
@@ -444,7 +444,7 @@ def set(self, key: str, value: str, **kwargs: Any) -> base.RESTObject:
444444 Returns:
445445 obj: The created/updated attribute
446446 """
447- path = "%s/%s" % ( self .path , utils .clean_str_id (key ))
447+ path = f" { self .path } / { utils .clean_str_id (key )} "
448448 data = {"value" : value }
449449 server_data = self .gitlab .http_put (path , post_data = data , ** kwargs )
450450 if TYPE_CHECKING :
@@ -479,7 +479,7 @@ def delete(self, id: Union[str, int], **kwargs: Any) -> None:
479479 else :
480480 if not isinstance (id , int ):
481481 id = utils .clean_str_id (id )
482- path = "%s/%s" % ( self .path , id )
482+ path = f" { self .path } / { id } "
483483 self .gitlab .http_delete (path , ** kwargs )
484484
485485
@@ -598,7 +598,7 @@ def user_agent_detail(self, **kwargs: Any) -> Dict[str, Any]:
598598 GitlabAuthenticationError: If authentication is not correct
599599 GitlabGetError: If the server cannot perform the request
600600 """
601- path = "%s/%s/user_agent_detail" % ( self .manager .path , self .get_id ())
601+ path = f" { self .manager .path } / { self .get_id ()} /user_agent_detail"
602602 result = self .manager .gitlab .http_get (path , ** kwargs )
603603 if TYPE_CHECKING :
604604 assert not isinstance (result , requests .Response )
@@ -631,7 +631,7 @@ def approve(
631631 GitlabUpdateError: If the server fails to perform the request
632632 """
633633
634- path = "%s/%s/approve" % ( self .manager .path , self .id )
634+ path = f" { self .manager .path } / { self .id } /approve"
635635 data = {"access_level" : access_level }
636636 server_data = self .manager .gitlab .http_put (path , post_data = data , ** kwargs )
637637 if TYPE_CHECKING :
@@ -654,7 +654,7 @@ def download(
654654 streamed : bool = False ,
655655 action : Optional [Callable ] = None ,
656656 chunk_size : int = 1024 ,
657- ** kwargs : Any
657+ ** kwargs : Any ,
658658 ) -> Optional [bytes ]:
659659 """Download the archive of a resource export.
660660
@@ -674,7 +674,7 @@ def download(
674674 Returns:
675675 str: The blob content if streamed is False, None otherwise
676676 """
677- path = "%s/download" % ( self .manager .path )
677+ path = f" { self .manager .path } /download"
678678 result = self .manager .gitlab .http_get (
679679 path , streamed = streamed , raw = True , ** kwargs
680680 )
@@ -705,7 +705,7 @@ def subscribe(self, **kwargs: Any) -> None:
705705 GitlabAuthenticationError: If authentication is not correct
706706 GitlabSubscribeError: If the subscription cannot be done
707707 """
708- path = "%s/%s/subscribe" % ( self .manager .path , self .get_id ())
708+ path = f" { self .manager .path } / { self .get_id ()} /subscribe"
709709 server_data = self .manager .gitlab .http_post (path , ** kwargs )
710710 if TYPE_CHECKING :
711711 assert not isinstance (server_data , requests .Response )
@@ -725,7 +725,7 @@ def unsubscribe(self, **kwargs: Any) -> None:
725725 GitlabAuthenticationError: If authentication is not correct
726726 GitlabUnsubscribeError: If the unsubscription cannot be done
727727 """
728- path = "%s/%s/unsubscribe" % ( self .manager .path , self .get_id ())
728+ path = f" { self .manager .path } / { self .get_id ()} /unsubscribe"
729729 server_data = self .manager .gitlab .http_post (path , ** kwargs )
730730 if TYPE_CHECKING :
731731 assert not isinstance (server_data , requests .Response )
@@ -752,7 +752,7 @@ def todo(self, **kwargs: Any) -> None:
752752 GitlabAuthenticationError: If authentication is not correct
753753 GitlabTodoError: If the todo cannot be set
754754 """
755- path = "%s/%s/todo" % ( self .manager .path , self .get_id ())
755+ path = f" { self .manager .path } / { self .get_id ()} /todo"
756756 self .manager .gitlab .http_post (path , ** kwargs )
757757
758758
@@ -781,7 +781,7 @@ def time_stats(self, **kwargs: Any) -> Dict[str, Any]:
781781 if "time_stats" in self .attributes :
782782 return self .attributes ["time_stats" ]
783783
784- path = "%s/%s/time_stats" % ( self .manager .path , self .get_id ())
784+ path = f" { self .manager .path } / { self .get_id ()} /time_stats"
785785 result = self .manager .gitlab .http_get (path , ** kwargs )
786786 if TYPE_CHECKING :
787787 assert not isinstance (result , requests .Response )
@@ -800,7 +800,7 @@ def time_estimate(self, duration: str, **kwargs: Any) -> Dict[str, Any]:
800800 GitlabAuthenticationError: If authentication is not correct
801801 GitlabTimeTrackingError: If the time tracking update cannot be done
802802 """
803- path = "%s/%s/time_estimate" % ( self .manager .path , self .get_id ())
803+ path = f" { self .manager .path } / { self .get_id ()} /time_estimate"
804804 data = {"duration" : duration }
805805 result = self .manager .gitlab .http_post (path , post_data = data , ** kwargs )
806806 if TYPE_CHECKING :
@@ -819,7 +819,7 @@ def reset_time_estimate(self, **kwargs: Any) -> Dict[str, Any]:
819819 GitlabAuthenticationError: If authentication is not correct
820820 GitlabTimeTrackingError: If the time tracking update cannot be done
821821 """
822- path = "%s/%s/reset_time_estimate" % ( self .manager .path , self .get_id ())
822+ path = f" { self .manager .path } / { self .get_id ()} /reset_time_estimate"
823823 result = self .manager .gitlab .http_post (path , ** kwargs )
824824 if TYPE_CHECKING :
825825 assert not isinstance (result , requests .Response )
@@ -838,7 +838,7 @@ def add_spent_time(self, duration: str, **kwargs: Any) -> Dict[str, Any]:
838838 GitlabAuthenticationError: If authentication is not correct
839839 GitlabTimeTrackingError: If the time tracking update cannot be done
840840 """
841- path = "%s/%s/add_spent_time" % ( self .manager .path , self .get_id ())
841+ path = f" { self .manager .path } / { self .get_id ()} /add_spent_time"
842842 data = {"duration" : duration }
843843 result = self .manager .gitlab .http_post (path , post_data = data , ** kwargs )
844844 if TYPE_CHECKING :
@@ -857,7 +857,7 @@ def reset_spent_time(self, **kwargs: Any) -> Dict[str, Any]:
857857 GitlabAuthenticationError: If authentication is not correct
858858 GitlabTimeTrackingError: If the time tracking update cannot be done
859859 """
860- path = "%s/%s/reset_spent_time" % ( self .manager .path , self .get_id ())
860+ path = f" { self .manager .path } / { self .get_id ()} /reset_spent_time"
861861 result = self .manager .gitlab .http_post (path , ** kwargs )
862862 if TYPE_CHECKING :
863863 assert not isinstance (result , requests .Response )
@@ -893,7 +893,7 @@ def participants(self, **kwargs: Any) -> Dict[str, Any]:
893893 RESTObjectList: The list of participants
894894 """
895895
896- path = "%s/%s/participants" % ( self .manager .path , self .get_id ())
896+ path = f" { self .manager .path } / { self .get_id ()} /participants"
897897 result = self .manager .gitlab .http_get (path , ** kwargs )
898898 if TYPE_CHECKING :
899899 assert not isinstance (result , requests .Response )
@@ -920,7 +920,7 @@ def render(self, link_url: str, image_url: str, **kwargs: Any) -> Dict[str, Any]
920920 Returns:
921921 dict: The rendering properties
922922 """
923- path = "%s/render" % self .path
923+ path = f" { self .path } /render"
924924 data = {"link_url" : link_url , "image_url" : image_url }
925925 result = self .gitlab .http_get (path , data , ** kwargs )
926926 if TYPE_CHECKING :
@@ -967,7 +967,7 @@ def promote(self, **kwargs: Any) -> Dict[str, Any]:
967967 dict: The updated object data (*not* a RESTObject)
968968 """
969969
970- path = "%s/%s/promote" % ( self .manager .path , self .id )
970+ path = f" { self .manager .path } / { self .id } /promote"
971971 http_method = self ._get_update_method ()
972972 result = http_method (path , ** kwargs )
973973 if TYPE_CHECKING :
0 commit comments