// Path: app/src/production/java/com/nilhcem/droidcontn/data/network/ApiEndpoint.java
// public enum ApiEndpoint {
// 
//     PROD(BuildConfig.API_ENDPOINT);
// 
//     public String url;
// 
//     ApiEndpoint(String url) {
//         this.url = url;
//     }
// 
//     public static ApiEndpoint get(Context context) {
//         return PROD;
//     }
// }
// 
// Path: app/src/main/java/com/nilhcem/droidcontn/data/network/DroidconService.java
// public interface DroidconService {
// 
//     @GET("sessions")
//     Observable<List<Session>> loadSessions();
// 
//     @GET("speakers")
//     Observable<List<Speaker>> loadSpeakers();
// }


import android.app.Application;
import com.nilhcem.droidcontn.data.network.ApiEndpoint;
import com.nilhcem.droidcontn.data.network.DroidconService;
import com.squareup.moshi.Moshi;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.moshi.MoshiConverterFactory;
package com.nilhcem.droidcontn.core.dagger.module;





@Module
public final class ApiModule {

    @Provides @Singleton ApiEndpoint provideApiEndpoint(Application context) {
        return ApiEndpoint.get(context);
    }

    @Provides @Singleton Retrofit provideRetrofit(OkHttpClient client, Moshi moshi, ApiEndpoint endpoint) {
        return new Retrofit.Builder()
                .client(client)
                .baseUrl(endpoint.url)
                .addConverterFactory(MoshiConverterFactory.create(moshi))
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                .build();
    }

    @Provides @Singleton DroidconService provideDroidconService(Retrofit retrofit) {
// Path: app/src/production/java/com/nilhcem/droidcontn/data/network/ApiEndpoint.java
// public enum ApiEndpoint {
// 
//     PROD(BuildConfig.API_ENDPOINT);
// 
//     public String url;
// 
//     ApiEndpoint(String url) {
//         this.url = url;
//     }
// 
//     public static ApiEndpoint get(Context context) {
//         return PROD;
//     }
// }
// 
// Path: app/src/main/java/com/nilhcem/droidcontn/data/network/DroidconService.java
// public interface DroidconService {
// 
//     @GET("sessions")
//     Observable<List<Session>> loadSessions();
// 
//     @GET("speakers")
//     Observable<List<Speaker>> loadSpeakers();
// }


// Path: app/src/main/java/com/nilhcem/droidcontn/core/dagger/module/ApiModule.java
import android.app.Application;
import com.nilhcem.droidcontn.data.network.ApiEndpoint;
import com.nilhcem.droidcontn.data.network.DroidconService;
import com.squareup.moshi.Moshi;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.moshi.MoshiConverterFactory;

package com.nilhcem.droidcontn.core.dagger.module;





@Module
public final class ApiModule {

    @Provides @Singleton ApiEndpoint provideApiEndpoint(Application context) {
        return ApiEndpoint.get(context);
    }

    @Provides @Singleton Retrofit provideRetrofit(OkHttpClient client, Moshi moshi, ApiEndpoint endpoint) {
        return new Retrofit.Builder()
                .client(client)
                .baseUrl(endpoint.url)
                .addConverterFactory(MoshiConverterFactory.create(moshi))
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                .build();
    }

    @Provides @Singleton DroidconService provideDroidconService(Retrofit retrofit) {
        return retrofit.create(DroidconService.class);