Skip to content

Commit 2fd92dc

Browse files
committed
initial implementation of ListVotes()
1 parent 9cd8431 commit 2fd92dc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

changes_reviewer.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,21 @@ func (s *ChangesService) DeleteReviewer(changeID, accountID string) (*Response,
124124
u := fmt.Sprintf("changes/%s/reviewers/%s", changeID, accountID)
125125
return s.client.DeleteRequest(u, nil)
126126
}
127+
128+
// ListVotes lists the votes for a specific reviewer of the change.
129+
//
130+
// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#list-votes
131+
func (s *ChangesService) ListVotes(changeID string, accountID string) (map[string]int, *Response, error) {
132+
u := fmt.Sprintf("changes/%s/reviewers/%s/votes/", changeID, accountID)
133+
req, err := s.client.NewRequest("GET", u, nil)
134+
if err != nil {
135+
return nil, nil, err
136+
}
137+
138+
var v map[string]int
139+
resp, err := s.client.Do(req, v)
140+
if err != nil {
141+
return nil, resp, err
142+
}
143+
return v, resp, err
144+
}

0 commit comments

Comments
 (0)