Search in sources :

Example 1 with DeleteVoteInput

use of com.google.copybara.git.gerritapi.DeleteVoteInput in project copybara by google.

the class GerritEndpoint method deleteVote.

@StarlarkMethod(name = "delete_vote", doc = "Delete a label vote from an account owner on a Gerrit change.\n", parameters = { @Param(name = "change_id", named = true, doc = "The Gerrit change id."), @Param(name = "account_id", named = true, doc = "The account owner who votes on label_id. Use 'me' or 'self' " + "if the account owner makes this api call"), @Param(name = "label_id", named = true, doc = "The name of the label.") })
public void deleteVote(String changeId, String accountId, String labelId) throws EvalException {
    try {
        GerritApi gerritApi = apiSupplier.load(console);
        gerritApi.deleteVote(changeId, accountId, labelId, new DeleteVoteInput(NotifyType.NONE));
    } catch (RepoException | ValidationException | RuntimeException e) {
        throw new EvalException("Error calling delete_vote: " + e.getMessage(), e);
    }
}
Also used : DeleteVoteInput(com.google.copybara.git.gerritapi.DeleteVoteInput) ValidationException(com.google.copybara.exception.ValidationException) RepoException(com.google.copybara.exception.RepoException) EvalException(net.starlark.java.eval.EvalException) GerritApi(com.google.copybara.git.gerritapi.GerritApi) StarlarkMethod(net.starlark.java.annot.StarlarkMethod)

Aggregations

RepoException (com.google.copybara.exception.RepoException)1 ValidationException (com.google.copybara.exception.ValidationException)1 DeleteVoteInput (com.google.copybara.git.gerritapi.DeleteVoteInput)1 GerritApi (com.google.copybara.git.gerritapi.GerritApi)1 StarlarkMethod (net.starlark.java.annot.StarlarkMethod)1 EvalException (net.starlark.java.eval.EvalException)1