@@ -50,38 +50,6 @@ class ProjectApprovalManager(GetWithoutIdMixin, UpdateMixin, RESTManager):
5050 def get (self , ** kwargs : Any ) -> ProjectApproval :
5151 return cast (ProjectApproval , super ().get (** kwargs ))
5252
53- @exc .on_http_error (exc .GitlabUpdateError )
54- def set_approvers (
55- self ,
56- approver_ids : Optional [List [int ]] = None ,
57- approver_group_ids : Optional [List [int ]] = None ,
58- ** kwargs : Any ,
59- ) -> Dict [str , Any ]:
60- """Change project-level allowed approvers and approver groups.
61-
62- Args:
63- approver_ids: User IDs that can approve MRs
64- approver_group_ids: Group IDs whose members can approve MRs
65-
66- Raises:
67- GitlabAuthenticationError: If authentication is not correct
68- GitlabUpdateError: If the server failed to perform the request
69-
70- Returns:
71- A dict value of the result
72- """
73- approver_ids = approver_ids or []
74- approver_group_ids = approver_group_ids or []
75-
76- if TYPE_CHECKING :
77- assert self ._parent is not None
78- path = f"/projects/{ self ._parent .encoded_id } /approvers"
79- data = {"approver_ids" : approver_ids , "approver_group_ids" : approver_group_ids }
80- result = self .gitlab .http_put (path , post_data = data , ** kwargs )
81- if TYPE_CHECKING :
82- assert isinstance (result , dict )
83- return result
84-
8553
8654class ProjectApprovalRule (SaveMixin , ObjectDeleteMixin , RESTObject ):
8755 _id_attr = "id"
0 commit comments