use of com.google.gerrit.client.rpc.RestApi in project gerrit by GerritCodeReview.
the class ProjectApi method setDescription.
public static void setDescription(Project.NameKey name, String description, AsyncCallback<NativeString> cb) {
RestApi call = project(name).view("description");
if (description != null && !description.isEmpty()) {
DescriptionInput input = DescriptionInput.create();
input.setDescription(description);
call.put(input, cb);
} else {
call.delete(cb);
}
}
use of com.google.gerrit.client.rpc.RestApi in project gerrit by GerritCodeReview.
the class ProjectMap method match.
public static void match(String match, int limit, int start, AsyncCallback<ProjectMap> cb) {
RestApi call = new RestApi("/projects/");
if (match != null) {
if (match.startsWith("^")) {
call.addParameter("r", match);
} else {
call.addParameter("m", match);
}
}
if (limit > 0) {
call.addParameter("n", limit);
}
if (start > 0) {
call.addParameter("S", start);
}
call.addParameterRaw("type", "ALL");
// description
call.addParameterTrue("d");
call.get(NativeMap.copyKeysIntoChildren(cb));
}
Aggregations