// Path: app/src/main/java/com/khmelenko/lab/varis/storage/AppSettings.java
// public class AppSettings {
// 
//     private static final String ACCESS_TOKEN_KEY = "TravisAccessToken";
//     private static final String SERVER_TYPE_KEY = "ServerTypeKey";
//     private static final String SERVER_URL_KEY = "ServerUrlKey";
// 
//     private SharedPreferences mSharedPreferences;
// 
//     public AppSettings(Context context) {
//         mSharedPreferences = getPreferences(context);
//     }
// 
//     /**
//      * Gets shared preferences
//      *
//      * @return Shared preferences
//      */
//     private SharedPreferences getPreferences(Context context) {
//         return PreferenceManager.getDefaultSharedPreferences(context);
//     }
// 
//     /**
//      * Gets access token
//      *
//      * @return Access token
//      */
//     public String getAccessToken() {
//         return mSharedPreferences.getString(ACCESS_TOKEN_KEY, "");
//     }
// 
//     /**
//      * Puts access token to settings
//      *
//      * @param accessToken Access token
//      */
//     public void putAccessToken(String accessToken) {
//         SharedPreferences.Editor editor = mSharedPreferences.edit();
//         editor.putString(ACCESS_TOKEN_KEY, accessToken);
//         editor.apply();
//     }
// 
//     /**
//      * Gets server type from Settings
//      *
//      * @return Server type
//      */
//     public int getServerType() {
//         return mSharedPreferences.getInt(SERVER_TYPE_KEY, 1);
//     }
// 
//     /**
//      * Puts server type to the settings
//      *
//      * @param serverType Server type
//      */
//     public void putServerType(int serverType) {
//         SharedPreferences.Editor editor = mSharedPreferences.edit();
//         editor.putInt(SERVER_TYPE_KEY, serverType);
//         editor.apply();
//     }
// 
//     /**
//      * Gets server url from Settings
//      *
//      * @return Server type
//      */
//     public String getServerUrl() {
//         return mSharedPreferences.getString(SERVER_URL_KEY, "");
//     }
// 
//     /**
//      * Puts server url to the settings
//      *
//      * @param serverUrl Server type
//      */
//     public void putServerUrl(String serverUrl) {
//         SharedPreferences.Editor editor = mSharedPreferences.edit();
//         editor.putString(SERVER_URL_KEY, serverUrl);
//         editor.apply();
//     }
// 
// }


import com.khmelenko.lab.varis.storage.AppSettings;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import io.reactivex.Single;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;
import retrofit2.Converter;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
     * @return Raw API service
     */
    public RawApiService getApiService() {
        return mRawApiService;
    }

    /**
     * Executes single request
     *
     * @param url URL for request
     * @return Response
     */
    public Single<Response> singleRequest(String url) {

        Request request = new Request.Builder()
                .url(url)
                .build();

        return Single.create(e -> {
            Response response = mHttpClient.newCall(request).execute();
            e.onSuccess(response);
        });
    }

    /**
     * Executes single request
     *
     * @param url URL for request
     * @return String
     */
// Path: app/src/main/java/com/khmelenko/lab/varis/storage/AppSettings.java
// public class AppSettings {
// 
//     private static final String ACCESS_TOKEN_KEY = "TravisAccessToken";
//     private static final String SERVER_TYPE_KEY = "ServerTypeKey";
//     private static final String SERVER_URL_KEY = "ServerUrlKey";
// 
//     private SharedPreferences mSharedPreferences;
// 
//     public AppSettings(Context context) {
//         mSharedPreferences = getPreferences(context);
//     }
// 
//     /**
//      * Gets shared preferences
//      *
//      * @return Shared preferences
//      */
//     private SharedPreferences getPreferences(Context context) {
//         return PreferenceManager.getDefaultSharedPreferences(context);
//     }
// 
//     /**
//      * Gets access token
//      *
//      * @return Access token
//      */
//     public String getAccessToken() {
//         return mSharedPreferences.getString(ACCESS_TOKEN_KEY, "");
//     }
// 
//     /**
//      * Puts access token to settings
//      *
//      * @param accessToken Access token
//      */
//     public void putAccessToken(String accessToken) {
//         SharedPreferences.Editor editor = mSharedPreferences.edit();
//         editor.putString(ACCESS_TOKEN_KEY, accessToken);
//         editor.apply();
//     }
// 
//     /**
//      * Gets server type from Settings
//      *
//      * @return Server type
//      */
//     public int getServerType() {
//         return mSharedPreferences.getInt(SERVER_TYPE_KEY, 1);
//     }
// 
//     /**
//      * Puts server type to the settings
//      *
//      * @param serverType Server type
//      */
//     public void putServerType(int serverType) {
//         SharedPreferences.Editor editor = mSharedPreferences.edit();
//         editor.putInt(SERVER_TYPE_KEY, serverType);
//         editor.apply();
//     }
// 
//     /**
//      * Gets server url from Settings
//      *
//      * @return Server type
//      */
//     public String getServerUrl() {
//         return mSharedPreferences.getString(SERVER_URL_KEY, "");
//     }
// 
//     /**
//      * Puts server url to the settings
//      *
//      * @param serverUrl Server type
//      */
//     public void putServerUrl(String serverUrl) {
//         SharedPreferences.Editor editor = mSharedPreferences.edit();
//         editor.putString(SERVER_URL_KEY, serverUrl);
//         editor.apply();
//     }
// 
// }


// Path: app/src/main/java/com/khmelenko/lab/varis/network/retrofit/raw/RawClient.java
import com.khmelenko.lab.varis.storage.AppSettings;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import io.reactivex.Single;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;
import retrofit2.Converter;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;

     * @return Raw API service
     */
    public RawApiService getApiService() {
        return mRawApiService;
    }

    /**
     * Executes single request
     *
     * @param url URL for request
     * @return Response
     */
    public Single<Response> singleRequest(String url) {

        Request request = new Request.Builder()
                .url(url)
                .build();

        return Single.create(e -> {
            Response response = mHttpClient.newCall(request).execute();
            e.onSuccess(response);
        });
    }

    /**
     * Executes single request
     *
     * @param url URL for request
     * @return String
     */
    public Single<String> singleStringRequest(String url) {