src/main/java/org/lightcouch/Replication.java
private JsonObject createJson() {
		JsonObject json = new JsonObject();
		addProperty(json, "source", source);
		addProperty(json, "cancel", cancel);
		addProperty(json, "continuous", continuous);
		addProperty(json, "filter", filter);
		
		if(queryParams != null) 
			json.add("query_params", queryParams);
		if(docIds != null) 
			json.add("doc_ids", dbc.getGson().toJsonTree(docIds, String[].class));
		
		addProperty(json, "proxy", proxy);
		addProperty(json, "since_seq", sinceSeq);
		addProperty(json, "create_target", createTarget);
		
		if(targetOauth != null) {
			JsonObject auth = new JsonObject();
			JsonObject oauth = new JsonObject();
			addProperty(oauth, "consumer_secret", consumerSecret);
			addProperty(oauth, "consumer_key", consumerKey);
			addProperty(oauth, "token_secret", tokenSecret);
			addProperty(oauth, "token", token);
			
			addProperty(targetOauth, "url", target);
			auth.add("oauth", oauth);
			
			targetOauth.add("auth", auth);
			json.add("target", targetOauth);
		} else {
			addProperty(json, "target", target);
		}
		return json;
	}
private JsonObject createJson() {
		JsonObject json = new JsonObject();
		addProperty(json, "source", source);
		addProperty(json, "cancel", cancel);
		addProperty(json, "continuous", continuous);
		addProperty(json, "filter", filter);
		
		if(queryParams != null) 
			json.add("query_params", queryParams);
		if(docIds != null) 
			json.add("doc_ids", dbc.getGson().toJsonTree(docIds, String[].class));
		
		addProperty(json, "proxy", proxy);
		addProperty(json, "since_seq", sinceSeq);
		addProperty(json, "create_target", createTarget);
		
		if(targetOauth != null) {
			JsonObject auth = new JsonObject();
			JsonObject oauth = new JsonObject();
			addProperty(oauth, "consumer_secret", consumerSecret);
			addProperty(oauth, "consumer_key", consumerKey);
			addProperty(oauth, "token_secret", tokenSecret);
			addProperty(oauth, "token", token);
			
			addProperty(targetOauth, "url", target);
			auth.add("oauth", oauth);
			
			targetOauth.add("auth", auth);
			json.add("target", targetOauth);
		} else {
			addProperty(json, "target", target);
		}
		return json;
	}
helper