Skip to content

Commit

Permalink
upd: reset approvals added
Browse files Browse the repository at this point in the history
  • Loading branch information
castlesofplacebo committed Mar 12, 2024
1 parent 65c4275 commit 0c85713
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions merge_request_approvals.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,26 @@ func (s *MergeRequestApprovalsService) UnapproveMergeRequest(pid interface{}, mr
return s.client.Do(req, nil)
}

// ResetApprovalsOfMergeRequest clear all approvals of merge request on GitLab.
// Available only for bot users based on project or group tokens.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/merge_request_approvals.html#reset-approvals-of-a-merge-request
func (s *MergeRequestApprovalsService) ResetApprovalsOfMergeRequest(pid interface{}, mr int, options ...RequestOptionFunc) (*Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, err
}
u := fmt.Sprintf("projects/%s/merge_requests/%d/reset_approvals", PathEscape(project), mr)

req, err := s.client.NewRequest(http.MethodPut, u, nil, options)
if err != nil {
return nil, err
}

return s.client.Do(req, nil)
}

// ChangeMergeRequestApprovalConfigurationOptions represents the available
// ChangeMergeRequestApprovalConfiguration() options.
//
Expand Down

0 comments on commit 0c85713

Please sign in to comment.