Skip to content

Commit 07d7463

Browse files
committed
initial implementation of DeleteVote()
1 parent 2fd92dc commit 07d7463

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

changes_reviewer.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ type AddReviewerResult struct {
2525
Confirm bool `json:"confirm,omitempty"`
2626
}
2727

28+
// DeleteVoteInput entity contains options for the deletion of a vote.
29+
//
30+
// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-vote-input
31+
type DeleteVoteInput struct {
32+
Label string `json:"label,omitempty"`
33+
Notify string `json:"notify,omitempty"`
34+
NotifyDetails map[string]NotifyInfo `json:"notify_details"`
35+
}
36+
2837
// ListReviewers lists the reviewers of a change.
2938
//
3039
// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-reviewers
@@ -142,3 +151,13 @@ func (s *ChangesService) ListVotes(changeID string, accountID string) (map[strin
142151
}
143152
return v, resp, err
144153
}
154+
155+
// DeleteVote deletes a single vote from a change. Note, that even when the
156+
// last vote of a reviewer is removed the reviewer itself is still listed on
157+
// the change.
158+
//
159+
// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-vote
160+
func (s *ChangesService) DeleteVote(changeID string, accountID string, label string, input *DeleteVoteInput) (*Response, error) {
161+
u := fmt.Sprintf("changes/%s/reviewers/%s/%s", changeID, accountID, label)
162+
return s.client.DeleteRequest(u, input)
163+
}

0 commit comments

Comments
 (0)