use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class BelongAPI method list.
public List<Belong> list(Object user, Object group, int limit) {
checkLimit(limit, "Limit");
Map<String, Object> params = new LinkedHashMap<>();
params.put("limit", limit);
params.put("user", formatEntityId(user));
params.put("group", formatEntityId(group));
RestResult result = this.client.get(this.path(), params);
return result.readList(this.type(), Belong.class);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class ProjectAPI method removeGraphs.
public Project removeGraphs(Object projectId, Set<String> graphs) {
Project project = new Project();
project.graphs(graphs);
RestResult result = this.client.put(this.path(), formatEntityId(projectId), project, ImmutableMap.of("action", ACTION_REMOVE_GRAPH));
return result.readObject(Project.class);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class ProjectAPI method addGraphs.
public Project addGraphs(Object projectId, Set<String> graphs) {
Project project = new Project();
project.graphs(graphs);
RestResult result = this.client.put(this.path(), formatEntityId(projectId), project, ImmutableMap.of("action", ACTION_ADD_GRAPH));
return result.readObject(Project.class);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class ProjectAPI method update.
public Project update(Project project) {
String id = formatEntityId(project.id());
RestResult result = this.client.put(this.path(), id, project);
return result.readObject(Project.class);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class GroupAPI method list.
public List<Group> list(int limit) {
checkLimit(limit, "Limit");
Map<String, Object> params = ImmutableMap.of("limit", limit);
RestResult result = this.client.get(this.path(), params);
return result.readList(this.type(), Group.class);
}
Aggregations