@@ -545,7 +545,7 @@ def save(self, **kwargs: Any) -> None:
545545 return
546546
547547 # call the manager
548- obj_id = self .get_id ()
548+ obj_id = self .encoded_id
549549 if TYPE_CHECKING :
550550 assert isinstance (self .manager , UpdateMixin )
551551 server_data = self .manager .update (obj_id , updated_data , ** kwargs )
@@ -575,6 +575,8 @@ def delete(self, **kwargs: Any) -> None:
575575 """
576576 if TYPE_CHECKING :
577577 assert isinstance (self .manager , DeleteMixin )
578+ # NOTE: Don't use `self.encoded_id` here as `self.manager.delete()` will encode
579+ # it.
578580 self .manager .delete (self .get_id (), ** kwargs )
579581
580582
@@ -598,7 +600,7 @@ def user_agent_detail(self, **kwargs: Any) -> Dict[str, Any]:
598600 GitlabAuthenticationError: If authentication is not correct
599601 GitlabGetError: If the server cannot perform the request
600602 """
601- path = f"{ self .manager .path } /{ self .get_id () } /user_agent_detail"
603+ path = f"{ self .manager .path } /{ self .encoded_id } /user_agent_detail"
602604 result = self .manager .gitlab .http_get (path , ** kwargs )
603605 if TYPE_CHECKING :
604606 assert not isinstance (result , requests .Response )
@@ -705,7 +707,7 @@ def subscribe(self, **kwargs: Any) -> None:
705707 GitlabAuthenticationError: If authentication is not correct
706708 GitlabSubscribeError: If the subscription cannot be done
707709 """
708- path = f"{ self .manager .path } /{ self .get_id () } /subscribe"
710+ path = f"{ self .manager .path } /{ self .encoded_id } /subscribe"
709711 server_data = self .manager .gitlab .http_post (path , ** kwargs )
710712 if TYPE_CHECKING :
711713 assert not isinstance (server_data , requests .Response )
@@ -725,7 +727,7 @@ def unsubscribe(self, **kwargs: Any) -> None:
725727 GitlabAuthenticationError: If authentication is not correct
726728 GitlabUnsubscribeError: If the unsubscription cannot be done
727729 """
728- path = f"{ self .manager .path } /{ self .get_id () } /unsubscribe"
730+ path = f"{ self .manager .path } /{ self .encoded_id } /unsubscribe"
729731 server_data = self .manager .gitlab .http_post (path , ** kwargs )
730732 if TYPE_CHECKING :
731733 assert not isinstance (server_data , requests .Response )
@@ -752,7 +754,7 @@ def todo(self, **kwargs: Any) -> None:
752754 GitlabAuthenticationError: If authentication is not correct
753755 GitlabTodoError: If the todo cannot be set
754756 """
755- path = f"{ self .manager .path } /{ self .get_id () } /todo"
757+ path = f"{ self .manager .path } /{ self .encoded_id } /todo"
756758 self .manager .gitlab .http_post (path , ** kwargs )
757759
758760
@@ -781,7 +783,7 @@ def time_stats(self, **kwargs: Any) -> Dict[str, Any]:
781783 if "time_stats" in self .attributes :
782784 return self .attributes ["time_stats" ]
783785
784- path = f"{ self .manager .path } /{ self .get_id () } /time_stats"
786+ path = f"{ self .manager .path } /{ self .encoded_id } /time_stats"
785787 result = self .manager .gitlab .http_get (path , ** kwargs )
786788 if TYPE_CHECKING :
787789 assert not isinstance (result , requests .Response )
@@ -800,7 +802,7 @@ def time_estimate(self, duration: str, **kwargs: Any) -> Dict[str, Any]:
800802 GitlabAuthenticationError: If authentication is not correct
801803 GitlabTimeTrackingError: If the time tracking update cannot be done
802804 """
803- path = f"{ self .manager .path } /{ self .get_id () } /time_estimate"
805+ path = f"{ self .manager .path } /{ self .encoded_id } /time_estimate"
804806 data = {"duration" : duration }
805807 result = self .manager .gitlab .http_post (path , post_data = data , ** kwargs )
806808 if TYPE_CHECKING :
@@ -819,7 +821,7 @@ def reset_time_estimate(self, **kwargs: Any) -> Dict[str, Any]:
819821 GitlabAuthenticationError: If authentication is not correct
820822 GitlabTimeTrackingError: If the time tracking update cannot be done
821823 """
822- path = f"{ self .manager .path } /{ self .get_id () } /reset_time_estimate"
824+ path = f"{ self .manager .path } /{ self .encoded_id } /reset_time_estimate"
823825 result = self .manager .gitlab .http_post (path , ** kwargs )
824826 if TYPE_CHECKING :
825827 assert not isinstance (result , requests .Response )
@@ -838,7 +840,7 @@ def add_spent_time(self, duration: str, **kwargs: Any) -> Dict[str, Any]:
838840 GitlabAuthenticationError: If authentication is not correct
839841 GitlabTimeTrackingError: If the time tracking update cannot be done
840842 """
841- path = f"{ self .manager .path } /{ self .get_id () } /add_spent_time"
843+ path = f"{ self .manager .path } /{ self .encoded_id } /add_spent_time"
842844 data = {"duration" : duration }
843845 result = self .manager .gitlab .http_post (path , post_data = data , ** kwargs )
844846 if TYPE_CHECKING :
@@ -857,7 +859,7 @@ def reset_spent_time(self, **kwargs: Any) -> Dict[str, Any]:
857859 GitlabAuthenticationError: If authentication is not correct
858860 GitlabTimeTrackingError: If the time tracking update cannot be done
859861 """
860- path = f"{ self .manager .path } /{ self .get_id () } /reset_spent_time"
862+ path = f"{ self .manager .path } /{ self .encoded_id } /reset_spent_time"
861863 result = self .manager .gitlab .http_post (path , ** kwargs )
862864 if TYPE_CHECKING :
863865 assert not isinstance (result , requests .Response )
@@ -893,7 +895,7 @@ def participants(self, **kwargs: Any) -> Dict[str, Any]:
893895 The list of participants
894896 """
895897
896- path = f"{ self .manager .path } /{ self .get_id () } /participants"
898+ path = f"{ self .manager .path } /{ self .encoded_id } /participants"
897899 result = self .manager .gitlab .http_get (path , ** kwargs )
898900 if TYPE_CHECKING :
899901 assert not isinstance (result , requests .Response )
0 commit comments