@@ -550,7 +550,7 @@ class UserAgentDetailMixin(_RestObjectBase):
550550 _updated_attrs : Dict [str , Any ]
551551 manager : base .RESTManager
552552
553- @cli .register_custom_action (("Snippet" , "ProjectSnippet" , "ProjectIssue" ))
553+ @cli .register_custom_action (cls_names = ("Snippet" , "ProjectSnippet" , "ProjectIssue" ))
554554 @exc .on_http_error (exc .GitlabGetError )
555555 def user_agent_detail (self , ** kwargs : Any ) -> Dict [str , Any ]:
556556 """Get the user agent detail.
@@ -578,7 +578,8 @@ class AccessRequestMixin(_RestObjectBase):
578578 manager : base .RESTManager
579579
580580 @cli .register_custom_action (
581- ("ProjectAccessRequest" , "GroupAccessRequest" ), (), ("access_level" ,)
581+ cls_names = ("ProjectAccessRequest" , "GroupAccessRequest" ),
582+ optional = ("access_level" ,),
582583 )
583584 @exc .on_http_error (exc .GitlabUpdateError )
584585 def approve (
@@ -611,7 +612,7 @@ class DownloadMixin(_RestObjectBase):
611612 _updated_attrs : Dict [str , Any ]
612613 manager : base .RESTManager
613614
614- @cli .register_custom_action (("GroupExport" , "ProjectExport" ))
615+ @cli .register_custom_action (cls_names = ("GroupExport" , "ProjectExport" ))
615616 @exc .on_http_error (exc .GitlabGetError )
616617 def download (
617618 self ,
@@ -721,7 +722,7 @@ class SubscribableMixin(_RestObjectBase):
721722 manager : base .RESTManager
722723
723724 @cli .register_custom_action (
724- ("ProjectIssue" , "ProjectMergeRequest" , "ProjectLabel" , "GroupLabel" )
725+ cls_names = ("ProjectIssue" , "ProjectMergeRequest" , "ProjectLabel" , "GroupLabel" )
725726 )
726727 @exc .on_http_error (exc .GitlabSubscribeError )
727728 def subscribe (self , ** kwargs : Any ) -> None :
@@ -741,7 +742,7 @@ def subscribe(self, **kwargs: Any) -> None:
741742 self ._update_attrs (server_data )
742743
743744 @cli .register_custom_action (
744- ("ProjectIssue" , "ProjectMergeRequest" , "ProjectLabel" , "GroupLabel" )
745+ cls_names = ("ProjectIssue" , "ProjectMergeRequest" , "ProjectLabel" , "GroupLabel" )
745746 )
746747 @exc .on_http_error (exc .GitlabUnsubscribeError )
747748 def unsubscribe (self , ** kwargs : Any ) -> None :
@@ -769,7 +770,7 @@ class TodoMixin(_RestObjectBase):
769770 _updated_attrs : Dict [str , Any ]
770771 manager : base .RESTManager
771772
772- @cli .register_custom_action (("ProjectIssue" , "ProjectMergeRequest" ))
773+ @cli .register_custom_action (cls_names = ("ProjectIssue" , "ProjectMergeRequest" ))
773774 @exc .on_http_error (exc .GitlabTodoError )
774775 def todo (self , ** kwargs : Any ) -> None :
775776 """Create a todo associated to the object.
@@ -793,7 +794,7 @@ class TimeTrackingMixin(_RestObjectBase):
793794 _updated_attrs : Dict [str , Any ]
794795 manager : base .RESTManager
795796
796- @cli .register_custom_action (("ProjectIssue" , "ProjectMergeRequest" ))
797+ @cli .register_custom_action (cls_names = ("ProjectIssue" , "ProjectMergeRequest" ))
797798 @exc .on_http_error (exc .GitlabTimeTrackingError )
798799 def time_stats (self , ** kwargs : Any ) -> Dict [str , Any ]:
799800 """Get time stats for the object.
@@ -819,7 +820,9 @@ def time_stats(self, **kwargs: Any) -> Dict[str, Any]:
819820 assert not isinstance (result , requests .Response )
820821 return result
821822
822- @cli .register_custom_action (("ProjectIssue" , "ProjectMergeRequest" ), ("duration" ,))
823+ @cli .register_custom_action (
824+ cls_names = ("ProjectIssue" , "ProjectMergeRequest" ), required = ("duration" ,)
825+ )
823826 @exc .on_http_error (exc .GitlabTimeTrackingError )
824827 def time_estimate (self , duration : str , ** kwargs : Any ) -> Dict [str , Any ]:
825828 """Set an estimated time of work for the object.
@@ -839,7 +842,7 @@ def time_estimate(self, duration: str, **kwargs: Any) -> Dict[str, Any]:
839842 assert not isinstance (result , requests .Response )
840843 return result
841844
842- @cli .register_custom_action (("ProjectIssue" , "ProjectMergeRequest" ))
845+ @cli .register_custom_action (cls_names = ("ProjectIssue" , "ProjectMergeRequest" ))
843846 @exc .on_http_error (exc .GitlabTimeTrackingError )
844847 def reset_time_estimate (self , ** kwargs : Any ) -> Dict [str , Any ]:
845848 """Resets estimated time for the object to 0 seconds.
@@ -857,7 +860,9 @@ def reset_time_estimate(self, **kwargs: Any) -> Dict[str, Any]:
857860 assert not isinstance (result , requests .Response )
858861 return result
859862
860- @cli .register_custom_action (("ProjectIssue" , "ProjectMergeRequest" ), ("duration" ,))
863+ @cli .register_custom_action (
864+ cls_names = ("ProjectIssue" , "ProjectMergeRequest" ), required = ("duration" ,)
865+ )
861866 @exc .on_http_error (exc .GitlabTimeTrackingError )
862867 def add_spent_time (self , duration : str , ** kwargs : Any ) -> Dict [str , Any ]:
863868 """Add time spent working on the object.
@@ -877,7 +882,7 @@ def add_spent_time(self, duration: str, **kwargs: Any) -> Dict[str, Any]:
877882 assert not isinstance (result , requests .Response )
878883 return result
879884
880- @cli .register_custom_action (("ProjectIssue" , "ProjectMergeRequest" ))
885+ @cli .register_custom_action (cls_names = ("ProjectIssue" , "ProjectMergeRequest" ))
881886 @exc .on_http_error (exc .GitlabTimeTrackingError )
882887 def reset_spent_time (self , ** kwargs : Any ) -> Dict [str , Any ]:
883888 """Resets the time spent working on the object.
@@ -904,7 +909,7 @@ class ParticipantsMixin(_RestObjectBase):
904909 _updated_attrs : Dict [str , Any ]
905910 manager : base .RESTManager
906911
907- @cli .register_custom_action (("ProjectMergeRequest" , "ProjectIssue" ))
912+ @cli .register_custom_action (cls_names = ("ProjectMergeRequest" , "ProjectIssue" ))
908913 @exc .on_http_error (exc .GitlabListError )
909914 def participants (self , ** kwargs : Any ) -> Dict [str , Any ]:
910915 """List the participants.
@@ -932,7 +937,8 @@ def participants(self, **kwargs: Any) -> Dict[str, Any]:
932937
933938class BadgeRenderMixin (_RestManagerBase ):
934939 @cli .register_custom_action (
935- ("GroupBadgeManager" , "ProjectBadgeManager" ), ("link_url" , "image_url" )
940+ cls_names = ("GroupBadgeManager" , "ProjectBadgeManager" ),
941+ required = ("link_url" , "image_url" ),
936942 )
937943 @exc .on_http_error (exc .GitlabRenderError )
938944 def render (self , link_url : str , image_url : str , ** kwargs : Any ) -> Dict [str , Any ]:
@@ -1025,7 +1031,9 @@ def _get_upload_path(self) -> str:
10251031 data = self .attributes
10261032 return self ._upload_path .format (** data )
10271033
1028- @cli .register_custom_action (("Project" , "ProjectWiki" ), ("filename" , "filepath" ))
1034+ @cli .register_custom_action (
1035+ cls_names = ("Project" , "ProjectWiki" ), required = ("filename" , "filepath" )
1036+ )
10291037 @exc .on_http_error (exc .GitlabUploadError )
10301038 def upload (
10311039 self ,
0 commit comments