// Path: rxuploader-sample/src/main/java/com/jagsaund/rxuploader/sample/config/Config.java
// public class Config {
//     public static final String HOST = "https://api.500px.com/";
// 
//     public static final HttpLoggingInterceptor.Level HTTP_LOG_LEVEL =
//             HttpLoggingInterceptor.Level.HEADERS;
// 
// 
//     public static final String REQUEST_TOKEN_URL = HOST + "v1/oauth/request_token";
//     public static final String ACCESS_TOKEN_URL = HOST + "v1/oauth/access_token";
//     public static final String AUTH_CALLBACK_URL = "";
// 
//     public static final String CONSUMER_KEY = "<INSERT YOUR 500PX CONSUMER KEY>";
//     public static final String CONSUMER_SECRET = "<INSERT YOUR 500PX CONSUMER SECRET>";
// 
//     public static final String X_AUTH_MODE = "client_auth";
//     public static final String X_AUTH_USERNAME = "<INSERT YOUR 500PX USERNAME>";
//     public static final String X_AUTH_PASSWORD = "<INSERT YOUR 500PX PASSWORD>";
// 
//     public static final String USERNAME = X_AUTH_USERNAME;
// }
// 
// Path: rxuploader-sample/src/main/java/com/jagsaund/rxuploader/sample/model/wire/JSONModelTypeAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class JSONModelTypeAdapterFactory implements TypeAdapterFactory {
//     @NonNull
//     public static TypeAdapterFactory create() {
//         return new AutoValueGson_JSONModelTypeAdapterFactory();
//     }
// }


import android.support.annotation.NonNull;
import com.google.gson.GsonBuilder;
import com.jagsaund.rxuploader.sample.config.Config;
import com.jagsaund.rxuploader.sample.model.wire.JSONModelTypeAdapterFactory;
import java.util.HashMap;
import java.util.Map;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
import se.akerfeldt.okhttp.signpost.OkHttpOAuthConsumer;
import se.akerfeldt.okhttp.signpost.SigningInterceptor;
package com.jagsaund.rxuploader.sample.service;


public final class Service {
    private static final Map<Class<?>, Object> serviceMap = new HashMap<>();

    private Service() {
    }

    @NonNull
    public static ApiService apiService(@NonNull String token, @NonNull String secret) {
        ApiService s = (ApiService) serviceMap.get(ApiService.class);
        if (s == null) {
            s = createService(ApiService.class, token, secret);
            serviceMap.put(ApiService.class, s);
        }
        return s;
    }

    @NonNull
    private static <S> S createService(@NonNull Class<S> s, @NonNull String token,
            @NonNull String secret) {
        final GsonConverterFactory serializer = GsonConverterFactory.create(
// Path: rxuploader-sample/src/main/java/com/jagsaund/rxuploader/sample/config/Config.java
// public class Config {
//     public static final String HOST = "https://api.500px.com/";
// 
//     public static final HttpLoggingInterceptor.Level HTTP_LOG_LEVEL =
//             HttpLoggingInterceptor.Level.HEADERS;
// 
// 
//     public static final String REQUEST_TOKEN_URL = HOST + "v1/oauth/request_token";
//     public static final String ACCESS_TOKEN_URL = HOST + "v1/oauth/access_token";
//     public static final String AUTH_CALLBACK_URL = "";
// 
//     public static final String CONSUMER_KEY = "<INSERT YOUR 500PX CONSUMER KEY>";
//     public static final String CONSUMER_SECRET = "<INSERT YOUR 500PX CONSUMER SECRET>";
// 
//     public static final String X_AUTH_MODE = "client_auth";
//     public static final String X_AUTH_USERNAME = "<INSERT YOUR 500PX USERNAME>";
//     public static final String X_AUTH_PASSWORD = "<INSERT YOUR 500PX PASSWORD>";
// 
//     public static final String USERNAME = X_AUTH_USERNAME;
// }
// 
// Path: rxuploader-sample/src/main/java/com/jagsaund/rxuploader/sample/model/wire/JSONModelTypeAdapterFactory.java
// @GsonTypeAdapterFactory
// public abstract class JSONModelTypeAdapterFactory implements TypeAdapterFactory {
//     @NonNull
//     public static TypeAdapterFactory create() {
//         return new AutoValueGson_JSONModelTypeAdapterFactory();
//     }
// }


// Path: rxuploader-sample/src/main/java/com/jagsaund/rxuploader/sample/service/Service.java
import android.support.annotation.NonNull;
import com.google.gson.GsonBuilder;
import com.jagsaund.rxuploader.sample.config.Config;
import com.jagsaund.rxuploader.sample.model.wire.JSONModelTypeAdapterFactory;
import java.util.HashMap;
import java.util.Map;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
import se.akerfeldt.okhttp.signpost.OkHttpOAuthConsumer;
import se.akerfeldt.okhttp.signpost.SigningInterceptor;

package com.jagsaund.rxuploader.sample.service;


public final class Service {
    private static final Map<Class<?>, Object> serviceMap = new HashMap<>();

    private Service() {
    }

    @NonNull
    public static ApiService apiService(@NonNull String token, @NonNull String secret) {
        ApiService s = (ApiService) serviceMap.get(ApiService.class);
        if (s == null) {
            s = createService(ApiService.class, token, secret);
            serviceMap.put(ApiService.class, s);
        }
        return s;
    }

    @NonNull
    private static <S> S createService(@NonNull Class<S> s, @NonNull String token,
            @NonNull String secret) {
        final GsonConverterFactory serializer = GsonConverterFactory.create(
                new GsonBuilder().registerTypeAdapterFactory(JSONModelTypeAdapterFactory.create())