@Override public JSONObject postRelationSettingsForNextVersion(String flow_id, String relationName, JSONArray jsonSchema, String bufferType, String authToken) throws APIException { JSONBuilder builder = new JSONStringer(); builder.object() .key("buffer_settings").object() .key("topic").value(relationName) .key("source").object() .key("type").value("s3") .key("retry").value(0) .key("config").object() .key("shard_path").value(relationName) .key("shard_prefix").value("shard_") .key("bucket").value("local") .key("credentials").object() .key("secret").value("") .key("access").value("") .endObject() .endObject() .endObject() .endObject() .endObject(); return JSONUtil.parseObj(builder.toString()); // Builder to JSONObject? }
private void mapField(final JSONBuilder props, final String path, final FieldBaseTypes type) { if (type == FieldBaseTypes.DATE) { props.key(path).object().key("type").value("date").endObject(); } }