// Path: app/src/main/java/toru/io/my/viperusage/model/InstagramResponse.java
// public class InstagramResponse {
//     public List<InstagramItemModel> items;
// 
//     @SerializedName("more_available")
//     public boolean moreAvailable;
// 
//     public String status;
// }
// 
// Path: app/src/main/java/toru/io/my/viperusage/network/ApiBase.java
// public class ApiBase {
//     private static final String TAG = ApiBase.class.getSimpleName();
// 
//     private static ApiBase instance;
//     private Retrofit retrofit;
// 
//     private ApiBase(String baseUrl){
//         initWithBaseUrl(baseUrl);
//     }
// 
//     public static ApiBase getInstance(String baseUrl){
//         if(instance == null){
//             instance = new ApiBase(baseUrl);
//         }
//         return instance;
//     }
// 
//     private void initWithBaseUrl(String baseUrl){
//         HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
//         loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
// 
//         OkHttpClient client = new OkHttpClient.Builder()
//                 .connectTimeout(5000, TimeUnit.MILLISECONDS)
//                 .readTimeout(5000, TimeUnit.MILLISECONDS)
//                 .writeTimeout(5000, TimeUnit.MILLISECONDS)
//                 .addInterceptor(loggingInterceptor)
//                 .build();
// 
//         retrofit = new Retrofit.Builder()
//                 .baseUrl(baseUrl)
//                 .addConverterFactory(GsonConverterFactory.create())
//                 .client(client)
//                 .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
//                 .build();
//     }
// 
//     public Retrofit getRetrofit(){
//         return retrofit;
//     }
// }
// 
// Path: app/src/main/java/toru/io/my/viperusage/network/services/IServices.java
// public interface IServices {
//     @GET("{filter}/media/")
//     Observable<InstagramResponse> getService(@Path("filter") String filter,
//                                              @Query("max_id") String maxId);
// }
// 
// Path: app/src/main/java/toru/io/my/viperusage/network/services/RequestModel.java
// public class RequestModel {
//     public String id;
//     public String maxId;
// }


import android.util.Log;
import org.json.JSONObject;
import java.util.List;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
import io.reactivex.schedulers.Schedulers;
import retrofit2.Retrofit;
import toru.io.my.viperusage.model.InstagramResponse;
import toru.io.my.viperusage.network.ApiBase;
import toru.io.my.viperusage.network.services.IServices;
import toru.io.my.viperusage.network.services.RequestModel;
package toru.io.my.viperusage.interactor;





/**
 * Created by toruchoi on 06/10/2017.
 */

public class InitInteractorImp implements InitInteractor{
    private static final String TAG = InitInteractorImp.class.getSimpleName();

    private InitInteractorOut out;

    public InitInteractorImp(InitInteractorOut out) {
        this.out = out;
    }

    @Override
    public void onGetResponse(RequestModel request) {
        Retrofit retrofit = ApiBase.getInstance("https://www.instagram.com/").getRetrofit();
// Path: app/src/main/java/toru/io/my/viperusage/model/InstagramResponse.java
// public class InstagramResponse {
//     public List<InstagramItemModel> items;
// 
//     @SerializedName("more_available")
//     public boolean moreAvailable;
// 
//     public String status;
// }
// 
// Path: app/src/main/java/toru/io/my/viperusage/network/ApiBase.java
// public class ApiBase {
//     private static final String TAG = ApiBase.class.getSimpleName();
// 
//     private static ApiBase instance;
//     private Retrofit retrofit;
// 
//     private ApiBase(String baseUrl){
//         initWithBaseUrl(baseUrl);
//     }
// 
//     public static ApiBase getInstance(String baseUrl){
//         if(instance == null){
//             instance = new ApiBase(baseUrl);
//         }
//         return instance;
//     }
// 
//     private void initWithBaseUrl(String baseUrl){
//         HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
//         loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
// 
//         OkHttpClient client = new OkHttpClient.Builder()
//                 .connectTimeout(5000, TimeUnit.MILLISECONDS)
//                 .readTimeout(5000, TimeUnit.MILLISECONDS)
//                 .writeTimeout(5000, TimeUnit.MILLISECONDS)
//                 .addInterceptor(loggingInterceptor)
//                 .build();
// 
//         retrofit = new Retrofit.Builder()
//                 .baseUrl(baseUrl)
//                 .addConverterFactory(GsonConverterFactory.create())
//                 .client(client)
//                 .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
//                 .build();
//     }
// 
//     public Retrofit getRetrofit(){
//         return retrofit;
//     }
// }
// 
// Path: app/src/main/java/toru/io/my/viperusage/network/services/IServices.java
// public interface IServices {
//     @GET("{filter}/media/")
//     Observable<InstagramResponse> getService(@Path("filter") String filter,
//                                              @Query("max_id") String maxId);
// }
// 
// Path: app/src/main/java/toru/io/my/viperusage/network/services/RequestModel.java
// public class RequestModel {
//     public String id;
//     public String maxId;
// }


// Path: app/src/main/java/toru/io/my/viperusage/interactor/InitInteractorImp.java
import android.util.Log;
import org.json.JSONObject;
import java.util.List;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
import io.reactivex.schedulers.Schedulers;
import retrofit2.Retrofit;
import toru.io.my.viperusage.model.InstagramResponse;
import toru.io.my.viperusage.network.ApiBase;
import toru.io.my.viperusage.network.services.IServices;
import toru.io.my.viperusage.network.services.RequestModel;

package toru.io.my.viperusage.interactor;





/**
 * Created by toruchoi on 06/10/2017.
 */

public class InitInteractorImp implements InitInteractor{
    private static final String TAG = InitInteractorImp.class.getSimpleName();

    private InitInteractorOut out;

    public InitInteractorImp(InitInteractorOut out) {
        this.out = out;
    }

    @Override
    public void onGetResponse(RequestModel request) {
        Retrofit retrofit = ApiBase.getInstance("https://www.instagram.com/").getRetrofit();
        IServices services = retrofit.create(IServices.class);