use of com.google.gerrit.extensions.common.Input in project gerrit by GerritCodeReview.
the class RevisionApiImpl method setReviewed.
@Override
public void setReviewed(String path, boolean reviewed) throws RestApiException {
try {
RestModifyView<FileResource, Input> view;
if (reviewed) {
view = putReviewed;
} else {
view = deleteReviewed;
}
view.apply(files.parse(revision, IdString.fromDecoded(path)), new Input());
} catch (Exception e) {
throw asRestApiException("Cannot update reviewed flag", e);
}
}
use of com.google.gerrit.extensions.common.Input in project gerrit by GerritCodeReview.
the class IndexChangesCommand method run.
@Override
protected void run() throws UnloggedFailure {
enableGracefulStop();
boolean ok = true;
for (ChangeResource rsrc : changes.values()) {
try {
index.apply(rsrc, new Input());
} catch (Exception e) {
ok = false;
writeError("error", String.format("failed to index change %s: %s", rsrc.getId(), e.getMessage()));
}
}
if (!ok) {
throw die("failed to index one or more changes");
}
}
use of com.google.gerrit.extensions.common.Input in project gerrit by GerritCodeReview.
the class AccountApiImpl method unstarChange.
@Override
public void unstarChange(String changeId) throws RestApiException {
try {
ChangeResource rsrc = changes.parse(TopLevelResource.INSTANCE, IdString.fromUrl(changeId));
AccountResource.StarredChange starredChange = new AccountResource.StarredChange(account.getUser(), rsrc);
starredChangesDelete.apply(starredChange, new Input());
} catch (Exception e) {
throw asRestApiException("Cannot unstar change", e);
}
}
Aggregations