package com.jraska.github.client.data.users;

import com.jraska.github.client.users.UsersRepository;
import dagger.Module;
import dagger.Provides;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

import javax.inject.Singleton;

@Module
public final class UsersModule {
  @Provides @Singleton UsersRepository provideUsersRepository(GitHubUsersApi gitHubUsersApi,
                                                              GitHubUserDetailApi detailApi) {
    return new GitHubApiUsersRepository(gitHubUsersApi, detailApi);
  }

  @Provides @Singleton GitHubUsersApi provideGitHubUsersApi(Retrofit retrofit) {
    return retrofit.create(GitHubUsersApi.class);
  }

  @Provides @Singleton GitHubUserDetailApi provideGitHubUserDetailApi(Retrofit retrofit) {
    return retrofit.create(GitHubUserDetailApi.class);
  }

  @Provides @Singleton Retrofit provideRetrofit(OkHttpClient okHttpClient) {
    Retrofit retrofit = new Retrofit.Builder()
        .baseUrl("https://api.github.com")
        .validateEagerly(true) // TODO: 17/08/16 AppConfig
        .client(okHttpClient)
        .addConverterFactory(GsonConverterFactory.create())
        .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
        .build();

    return retrofit;
  }
}

@@ -39,16 +39,71 @@
 users;%0A%0A
+import com.jraska.github.client.common.AppBuildConfig;%0A
 import c
@@ -503,298 +503,133 @@
 ory(
-GitHubUsersApi gitHubUsersApi,%0A                                                              GitHubUserDetailApi detailApi) %7B%0A    return new GitHubApiUsersRepository(gitHubUsersApi, detailApi);%0A  %7D%0A%0A  @Provides @Singleton GitHubUsersApi provideGitHubUsersApi(Retrofit retrofit) %7B%0A    return
+Retrofit retrofit) %7B%0A    GitHubUsersApi usersApi = retrofit.create(GitHubUsersApi.class);%0A    GitHubUserDetailApi detailApi =
  ret
@@ -643,33 +643,38 @@
 reate(GitHubUser
-s
+Detail
 Api.class);%0A  %7D%0A
@@ -673,150 +673,68 @@
 s);%0A
+%0A
   
-%7D%0A%0A  @Provides @Singleton GitHubUserDetailApi provideGitHubUserDetailApi(Retrofit retrofit) %7B%0A    return retrofit.create(GitHubUserD
+  return new GitHubApiUsersRepository(usersApi, d
 etailApi
 .cla
@@ -729,22 +729,16 @@
 etailApi
-.class
 );%0A  %7D%0A%0A
@@ -810,16 +810,39 @@
 tpClient
+, AppBuildConfig config
 ) %7B%0A    
@@ -956,41 +956,21 @@
 rly(
-true) // TODO: 17/08/16 AppConfig
+config.debug)
 %0A   

Remove extra methods for API clients