URI uri = newParams().forURL(config.newAPIEndpointURI(id == null ? CREATE : UPDATE));
POST request = config.http().POST(uri, new PageReader(newRequestCallback(future, new ManagedSource(), config)))
.form("source_type", source.type().value())
.form("name", name);
if (source.hasParams()) {
request.form("parameters", source.getParametersAsJSON());
}
if (source.hasResources()) {
request.form("resources", source.getResourcesAsJSON());
}
if (source.hasAuth()) {