@@ -545,7 +545,7 @@ def save(self, **kwargs: Any) -> None:
545
545
return
546
546
547
547
# call the manager
548
- obj_id = self .get_id ()
548
+ obj_id = self .encoded_id
549
549
if TYPE_CHECKING :
550
550
assert isinstance (self .manager , UpdateMixin )
551
551
server_data = self .manager .update (obj_id , updated_data , ** kwargs )
@@ -575,6 +575,8 @@ def delete(self, **kwargs: Any) -> None:
575
575
"""
576
576
if TYPE_CHECKING :
577
577
assert isinstance (self .manager , DeleteMixin )
578
+ # NOTE: Don't use `self.encoded_id` here as `self.manager.delete()` will encode
579
+ # it.
578
580
self .manager .delete (self .get_id (), ** kwargs )
579
581
580
582
@@ -598,7 +600,7 @@ def user_agent_detail(self, **kwargs: Any) -> Dict[str, Any]:
598
600
GitlabAuthenticationError: If authentication is not correct
599
601
GitlabGetError: If the server cannot perform the request
600
602
"""
601
- path = f"{ self .manager .path } /{ self .get_id () } /user_agent_detail"
603
+ path = f"{ self .manager .path } /{ self .encoded_id } /user_agent_detail"
602
604
result = self .manager .gitlab .http_get (path , ** kwargs )
603
605
if TYPE_CHECKING :
604
606
assert not isinstance (result , requests .Response )
@@ -705,7 +707,7 @@ def subscribe(self, **kwargs: Any) -> None:
705
707
GitlabAuthenticationError: If authentication is not correct
706
708
GitlabSubscribeError: If the subscription cannot be done
707
709
"""
708
- path = f"{ self .manager .path } /{ self .get_id () } /subscribe"
710
+ path = f"{ self .manager .path } /{ self .encoded_id } /subscribe"
709
711
server_data = self .manager .gitlab .http_post (path , ** kwargs )
710
712
if TYPE_CHECKING :
711
713
assert not isinstance (server_data , requests .Response )
@@ -725,7 +727,7 @@ def unsubscribe(self, **kwargs: Any) -> None:
725
727
GitlabAuthenticationError: If authentication is not correct
726
728
GitlabUnsubscribeError: If the unsubscription cannot be done
727
729
"""
728
- path = f"{ self .manager .path } /{ self .get_id () } /unsubscribe"
730
+ path = f"{ self .manager .path } /{ self .encoded_id } /unsubscribe"
729
731
server_data = self .manager .gitlab .http_post (path , ** kwargs )
730
732
if TYPE_CHECKING :
731
733
assert not isinstance (server_data , requests .Response )
@@ -752,7 +754,7 @@ def todo(self, **kwargs: Any) -> None:
752
754
GitlabAuthenticationError: If authentication is not correct
753
755
GitlabTodoError: If the todo cannot be set
754
756
"""
755
- path = f"{ self .manager .path } /{ self .get_id () } /todo"
757
+ path = f"{ self .manager .path } /{ self .encoded_id } /todo"
756
758
self .manager .gitlab .http_post (path , ** kwargs )
757
759
758
760
@@ -781,7 +783,7 @@ def time_stats(self, **kwargs: Any) -> Dict[str, Any]:
781
783
if "time_stats" in self .attributes :
782
784
return self .attributes ["time_stats" ]
783
785
784
- path = f"{ self .manager .path } /{ self .get_id () } /time_stats"
786
+ path = f"{ self .manager .path } /{ self .encoded_id } /time_stats"
785
787
result = self .manager .gitlab .http_get (path , ** kwargs )
786
788
if TYPE_CHECKING :
787
789
assert not isinstance (result , requests .Response )
@@ -800,7 +802,7 @@ def time_estimate(self, duration: str, **kwargs: Any) -> Dict[str, Any]:
800
802
GitlabAuthenticationError: If authentication is not correct
801
803
GitlabTimeTrackingError: If the time tracking update cannot be done
802
804
"""
803
- path = f"{ self .manager .path } /{ self .get_id () } /time_estimate"
805
+ path = f"{ self .manager .path } /{ self .encoded_id } /time_estimate"
804
806
data = {"duration" : duration }
805
807
result = self .manager .gitlab .http_post (path , post_data = data , ** kwargs )
806
808
if TYPE_CHECKING :
@@ -819,7 +821,7 @@ def reset_time_estimate(self, **kwargs: Any) -> Dict[str, Any]:
819
821
GitlabAuthenticationError: If authentication is not correct
820
822
GitlabTimeTrackingError: If the time tracking update cannot be done
821
823
"""
822
- path = f"{ self .manager .path } /{ self .get_id () } /reset_time_estimate"
824
+ path = f"{ self .manager .path } /{ self .encoded_id } /reset_time_estimate"
823
825
result = self .manager .gitlab .http_post (path , ** kwargs )
824
826
if TYPE_CHECKING :
825
827
assert not isinstance (result , requests .Response )
@@ -838,7 +840,7 @@ def add_spent_time(self, duration: str, **kwargs: Any) -> Dict[str, Any]:
838
840
GitlabAuthenticationError: If authentication is not correct
839
841
GitlabTimeTrackingError: If the time tracking update cannot be done
840
842
"""
841
- path = f"{ self .manager .path } /{ self .get_id () } /add_spent_time"
843
+ path = f"{ self .manager .path } /{ self .encoded_id } /add_spent_time"
842
844
data = {"duration" : duration }
843
845
result = self .manager .gitlab .http_post (path , post_data = data , ** kwargs )
844
846
if TYPE_CHECKING :
@@ -857,7 +859,7 @@ def reset_spent_time(self, **kwargs: Any) -> Dict[str, Any]:
857
859
GitlabAuthenticationError: If authentication is not correct
858
860
GitlabTimeTrackingError: If the time tracking update cannot be done
859
861
"""
860
- path = f"{ self .manager .path } /{ self .get_id () } /reset_spent_time"
862
+ path = f"{ self .manager .path } /{ self .encoded_id } /reset_spent_time"
861
863
result = self .manager .gitlab .http_post (path , ** kwargs )
862
864
if TYPE_CHECKING :
863
865
assert not isinstance (result , requests .Response )
@@ -893,7 +895,7 @@ def participants(self, **kwargs: Any) -> Dict[str, Any]:
893
895
The list of participants
894
896
"""
895
897
896
- path = f"{ self .manager .path } /{ self .get_id () } /participants"
898
+ path = f"{ self .manager .path } /{ self .encoded_id } /participants"
897
899
result = self .manager .gitlab .http_get (path , ** kwargs )
898
900
if TYPE_CHECKING :
899
901
assert not isinstance (result , requests .Response )
0 commit comments