package com.plaid.client;

import com.plaid.client.http.ApacheHttpClientHttpDelegate;
import com.plaid.client.http.WireLogger;

public class PlaidClients {

    public static final String BASE_URI_PRODUCTION = "https://api.plaid.com";
    public static final String BASE_URI_TEST = "https://tartan.plaid.com";
    
    public static PlaidUserClient productionUserClient(String clientId, String secret, WireLogger wireLogger) {            	    
    	return new DefaultPlaidUserClient(createHttpDelegate(BASE_URI_PRODUCTION, wireLogger), clientId, secret);
    }
    
    public static PlaidUserClient testUserClient(String clientId, String secret, WireLogger wireLogger) {    	
        return new DefaultPlaidUserClient(createHttpDelegate(BASE_URI_TEST, wireLogger), clientId, secret);    
    }
    
    public static PlaidPublicClient productionPublicClient(WireLogger wireLogger) {
        return new DefaultPlaidPublicClient(createHttpDelegate(BASE_URI_PRODUCTION, wireLogger));
    }
    
    public static PlaidPublicClient testPublicClient(WireLogger wireLogger) {
        return new DefaultPlaidPublicClient(createHttpDelegate(BASE_URI_TEST, wireLogger));
    }
    
    public static PlaidUserClient productionUserClient(String clientId, String secret) {        
    	return productionUserClient(clientId, secret, null);
    }
    
    public static PlaidUserClient testUserClient(String clientId, String secret) {        
         return testUserClient(clientId, secret, null);
    }
    
    public static PlaidPublicClient productionPublicClient() {
    	 return productionPublicClient(null);
    }
    
    public static PlaidPublicClient testPublicClient() {
    	 return testPublicClient(null);
    }
    
    private static ApacheHttpClientHttpDelegate createHttpDelegate(String uri, WireLogger wireLogger) {
    	ApacheHttpClientHttpDelegate httpDelegate = ApacheHttpClientHttpDelegate.createDefault(BASE_URI_PRODUCTION);
    	if (wireLogger != null) {
    		httpDelegate.setWireLogger(wireLogger);
    	}
    	return httpDelegate;
    }
}

@@ -1821,17 +1821,20 @@
 ) %7B%0A    
-%09
+    
 ApacheHt
@@ -1912,35 +1912,19 @@
 Default(
-BASE_URI_PRODUCTION
+uri
 );%0A    %09

Use the provided uri instead of the production uri