use of com.google.gerrit.extensions.restapi.RestApiException in project gerrit by GerritCodeReview.
the class ChangeApiImpl method get.
@Override
public ChangeInfo get(EnumSet<ListChangesOption> options, ImmutableListMultimap<String, String> pluginOptions) throws RestApiException {
try (DynamicOptions dynamicOptions = new DynamicOptions(injector, dynamicBeans)) {
GetChange getChange = getChangeProvider.get();
options.forEach(getChange::addOption);
dynamicOptionParser.parseDynamicOptions(getChange, pluginOptions, dynamicOptions);
return getChange.apply(change).value();
} catch (Exception e) {
throw asRestApiException("Cannot retrieve change", e);
}
}
use of com.google.gerrit.extensions.restapi.RestApiException in project gerrit by GerritCodeReview.
the class ChangeApiImpl method metaDiff.
@Override
public ChangeInfoDifference metaDiff(@Nullable String oldMetaRevId, @Nullable String newMetaRevId, EnumSet<ListChangesOption> options, ImmutableListMultimap<String, String> pluginOptions) throws RestApiException {
try (DynamicOptions dynamicOptions = new DynamicOptions(injector, dynamicBeans)) {
GetMetaDiff metaDiff = getMetaDiffProvider.get();
metaDiff.setOldMetaRevId(oldMetaRevId);
metaDiff.setNewMetaRevId(newMetaRevId);
options.forEach(metaDiff::addOption);
dynamicOptionParser.parseDynamicOptions(metaDiff, pluginOptions, dynamicOptions);
return metaDiff.apply(change).value();
} catch (Exception e) {
throw asRestApiException("Cannot retrieve metaDiff", e);
}
}
use of com.google.gerrit.extensions.restapi.RestApiException in project gerrit by GerritCodeReview.
the class ChangeApiImpl method pureRevert.
@Override
public PureRevertInfo pureRevert(@Nullable String claimedOriginal) throws RestApiException {
try {
GetPureRevert getPureRevert = getPureRevertProvider.get();
getPureRevert.setClaimedOriginal(claimedOriginal);
return getPureRevert.apply(change).value();
} catch (Exception e) {
throw asRestApiException("Cannot compute pure revert", e);
}
}
use of com.google.gerrit.extensions.restapi.RestApiException in project gerrit by GerritCodeReview.
the class RevisionApiImpl method getMergeList.
@Override
public MergeListRequest getMergeList() throws RestApiException {
return new MergeListRequest() {
@Override
public List<CommitInfo> get() throws RestApiException {
try {
GetMergeList gml = getMergeList.get();
gml.setUninterestingParent(getUninterestingParent());
gml.setAddLinks(getAddLinks());
return gml.apply(revision).value();
} catch (Exception e) {
throw asRestApiException("Cannot get merge list", e);
}
}
};
}
use of com.google.gerrit.extensions.restapi.RestApiException in project gerrit by GerritCodeReview.
the class GroupApiImpl method name.
@Override
public void name(String name) throws RestApiException {
NameInput in = new NameInput();
in.name = name;
try {
putName.apply(rsrc, in);
} catch (Exception e) {
throw asRestApiException("Cannot put group name", e);
}
}
Aggregations