use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class GroupAPI method update.
public Group update(Group group) {
String id = formatEntityId(group.id());
RestResult result = this.client.put(this.path(), id, group);
return result.readObject(Group.class);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class TargetAPI method list.
public List<Target> 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(), Target.class);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class UserAPI method update.
public User update(User user) {
String id = formatEntityId(user.id());
RestResult result = this.client.put(this.path(), id, user);
return result.readObject(User.class);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class UserAPI method getUserRole.
public UserRole getUserRole(Object id) {
String idEncoded = RestClient.encode(formatEntityId(id));
String path = String.join("/", this.path(), idEncoded, "role");
RestResult result = this.client.get(path);
return result.readObject(UserRole.class);
}
use of com.baidu.hugegraph.rest.RestResult in project incubator-hugegraph-toolchain by apache.
the class AccessAPI method list.
public List<Access> list(Object group, Object target, int limit) {
checkLimit(limit, "Limit");
Map<String, Object> params = new LinkedHashMap<>();
params.put("limit", limit);
params.put("group", formatEntityId(group));
params.put("target", formatEntityId(target));
RestResult result = this.client.get(this.path(), params);
return result.readList(this.type(), Access.class);
}
Aggregations