use of com.google.gerrit.client.rpc.RestApi in project gerrit by GerritCodeReview.
the class GroupMap method suggestAccountGroupForProject.
public static void suggestAccountGroupForProject(String project, String query, int limit, AsyncCallback<GroupMap> cb) {
RestApi call = groups();
if (project != null) {
call.addParameter("p", project);
}
if (query != null) {
call.addParameter("s", query);
}
if (limit > 0) {
call.addParameter("n", limit);
}
call.get(NativeMap.copyKeysIntoChildren(cb));
}
use of com.google.gerrit.client.rpc.RestApi in project gerrit by GerritCodeReview.
the class ProjectApi method getRestApi.
private static RestApi getRestApi(Project.NameKey name, String viewName, int limit, int start, String match) {
RestApi call = project(name).view(viewName);
call.addParameter("n", limit);
call.addParameter("s", start);
if (match != null) {
if (match.startsWith("^")) {
call.addParameter("r", match);
} else {
call.addParameter("m", match);
}
}
return call;
}
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));
}
use of com.google.gerrit.client.rpc.RestApi in project gerrit by GerritCodeReview.
the class AccessMap method get.
public static void get(Set<Project.NameKey> projects, AsyncCallback<AccessMap> callback) {
RestApi api = new RestApi("/access/");
for (Project.NameKey p : projects) {
api.addParameter("project", p.get());
}
api.get(NativeMap.copyKeysIntoChildren(callback));
}
Aggregations