use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class BelongAPI method update.
public Belong update(Belong belong) {
String id = formatRelationId(belong.id());
RestResult result = this.client.put(this.path(), id, belong);
return result.readObject(Belong.class);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class ProjectAPI method list.
public List<Project> list(long 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(), Project.class);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class TargetAPI method update.
public Target update(Target target) {
String id = formatEntityId(target.id());
RestResult result = this.client.put(this.path(), id, target);
return result.readObject(Target.class);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class UserAPI method list.
public List<User> 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(), User.class);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class CountAPI method post.
public long post(CountRequest request) {
this.client.checkApiVersion("0.55", "count");
RestResult result = this.client.post(this.path(), request);
@SuppressWarnings("unchecked") Map<String, Number> countMap = result.readObject(Map.class);
E.checkState(countMap.containsKey(COUNT), "The result doesn't have key '%s'", COUNT);
return countMap.get(COUNT).longValue();
}
Aggregations