// Path: app/src/main/java/com/pacoworks/dereference/network/LoggerInterceptor.java
// public class LoggerInterceptor implements Interceptor {
//     @Override
//     public Response intercept(Chain chain) throws IOException {
//         Timber.d("Started request ==> %s", chain.request().url().toString());
//         return chain.proceed(chain.request());
//     }
// }
// 
// Path: app/src/main/java/com/pacoworks/dereference/network/SongkickApi.java
// public interface SongkickApi {
//     @GET("search/artists.json")
//     Observable<SearchResult> getSearchResult(@Query("apikey") String apikey,
//             @Query("query") String url);
// 
//     @GET("artists/{artist_id}/similar_artists.json")
//     Observable<SearchResult> getRelatedArtists(@Path("artist_id") String artistId,
//             @Query("apikey") String apikey);
// }


import com.pacoworks.dereference.network.SongkickApi;
import com.squareup.okhttp.Cache;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.picasso.OkHttpDownloader;
import dagger.Module;
import dagger.Provides;
import java.io.File;
import java.util.concurrent.TimeUnit;
import javax.inject.Named;
import javax.inject.Singleton;
import retrofit.GsonConverterFactory;
import retrofit.Retrofit;
import retrofit.RxJavaCallAdapterFactory;
import com.facebook.stetho.okhttp.StethoInterceptor;
import com.google.gson.Gson;
import com.pacoworks.dereference.network.LoggerInterceptor;

    @Provides
    @Singleton
    Cache provideCache() {
        return new Cache(cacheDir, cacheSize);
    }

    @Provides
    @Singleton
    StethoInterceptor stethoInterceptor() {
        return new StethoInterceptor();
    }

    @Provides
    @Singleton
    LoggerInterceptor loggerInterceptor() {
        return new LoggerInterceptor();
    }

    @Provides
    @Named("songkick")
    @Singleton
    Retrofit provideRetrofitSongkick(OkHttpClient client, Gson gson) {
        return new Retrofit.Builder().client(client).baseUrl(endpointUrl)
                .addConverterFactory(GsonConverterFactory.create(gson))
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create()).build();
    }

    @Provides
    @Singleton
// Path: app/src/main/java/com/pacoworks/dereference/network/LoggerInterceptor.java
// public class LoggerInterceptor implements Interceptor {
//     @Override
//     public Response intercept(Chain chain) throws IOException {
//         Timber.d("Started request ==> %s", chain.request().url().toString());
//         return chain.proceed(chain.request());
//     }
// }
// 
// Path: app/src/main/java/com/pacoworks/dereference/network/SongkickApi.java
// public interface SongkickApi {
//     @GET("search/artists.json")
//     Observable<SearchResult> getSearchResult(@Query("apikey") String apikey,
//             @Query("query") String url);
// 
//     @GET("artists/{artist_id}/similar_artists.json")
//     Observable<SearchResult> getRelatedArtists(@Path("artist_id") String artistId,
//             @Query("apikey") String apikey);
// }


// Path: app/src/main/java/com/pacoworks/dereference/dependencies/modules/NetworkModule.java
import com.pacoworks.dereference.network.SongkickApi;
import com.squareup.okhttp.Cache;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.picasso.OkHttpDownloader;
import dagger.Module;
import dagger.Provides;
import java.io.File;
import java.util.concurrent.TimeUnit;
import javax.inject.Named;
import javax.inject.Singleton;
import retrofit.GsonConverterFactory;
import retrofit.Retrofit;
import retrofit.RxJavaCallAdapterFactory;
import com.facebook.stetho.okhttp.StethoInterceptor;
import com.google.gson.Gson;
import com.pacoworks.dereference.network.LoggerInterceptor;


    @Provides
    @Singleton
    Cache provideCache() {
        return new Cache(cacheDir, cacheSize);
    }

    @Provides
    @Singleton
    StethoInterceptor stethoInterceptor() {
        return new StethoInterceptor();
    }

    @Provides
    @Singleton
    LoggerInterceptor loggerInterceptor() {
        return new LoggerInterceptor();
    }

    @Provides
    @Named("songkick")
    @Singleton
    Retrofit provideRetrofitSongkick(OkHttpClient client, Gson gson) {
        return new Retrofit.Builder().client(client).baseUrl(endpointUrl)
                .addConverterFactory(GsonConverterFactory.create(gson))
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create()).build();
    }

    @Provides
    @Singleton
    SongkickApi provideSongkickApi(@Named("songkick") Retrofit retrofit) {