package com.aldoborrero.tinder.api;

import com.aldoborrero.tinder.api.model.TinderEndpoint;
import com.aldoborrero.tinder.api.model.TinderLog;
import com.aldoborrero.tinder.api.model.TinderLogLevel;
import com.aldoborrero.tinder.api.okhttp.interceptors.AuthTokenInterceptor;
import com.aldoborrero.tinder.api.retrofit.TinderErrorHandler;
import org.jetbrains.annotations.Nullable;
import retrofit.client.Header;

import java.util.Arrays;
import java.util.List;

public class Settings {

    private AuthTokenInterceptor authTokenInterceptor;
    private TinderErrorHandler errorHandler;
    private TinderEndpoint endpoint;
    private TinderLogLevel logLevel;
    private TinderLog log;

    public Settings() {
    }

    public Settings(AuthTokenInterceptor authTokenInterceptor, TinderErrorHandler errorHandler, TinderEndpoint endpoint, TinderLogLevel logLevel, TinderLog log) {
        this.authTokenInterceptor = authTokenInterceptor;
        this.errorHandler = errorHandler;
        this.endpoint = endpoint;
        this.logLevel = logLevel;
        this.log = log;
    }

    public AuthTokenInterceptor getAuthTokenInterceptor() {
        return authTokenInterceptor;
    }

    public void setAuthTokenInterceptor(AuthTokenInterceptor authTokenInterceptor) {
        this.authTokenInterceptor = authTokenInterceptor;
    }

    public TinderErrorHandler getErrorHandler() {
        return errorHandler;
    }

    public void setErrorHandler(TinderErrorHandler errorHandler) {
        this.errorHandler = errorHandler;
    }

    public TinderEndpoint getEndpoint() {
        return endpoint;
    }

    public void setEndpoint(TinderEndpoint endpoint) {
        this.endpoint = endpoint;
    }

    public TinderLogLevel getLogLevel() {
        return logLevel;
    }

    public void setLogLevel(TinderLogLevel logLevel) {
        this.logLevel = logLevel;
    }

    public TinderLog getLog() {
        return log;
    }

    public void setLog(TinderLog log) {
        this.log = log;
    }

    @Nullable
    public List<Header> getExtraHeaders() {
        return Arrays.asList(
                Headers.USER_AGENT_HEADER,
                Headers.OS_VERSION_HEADER,
                Headers.APP_VERSION_HEADER,
                Headers.PLATFORM_HEADER
        );
    }


    static class Headers {
        public static final Header USER_AGENT_HEADER = new Header("User-Agent", "Tinder Android Version 4.0.3");
        public static final Header OS_VERSION_HEADER = new Header("os-version", "21");
        public static final Header APP_VERSION_HEADER = new Header("app-version", "767");
        public static final Header PLATFORM_HEADER = new Header("platform", "android");

        private Headers() {
            throw new AssertionError("No instances of this class are allowed!");
        }
    }
}

@@ -68,79 +68,45 @@
 api.
-model.TinderEndpoint;%0Aimport com.aldoborrero.ti
+interfaces.TinderErrorHa
 nd
+l
 er
-.api.model.TinderLog
+Listener
 ;%0Aim
@@ -149,24 +149,24 @@
 l.Tinder
-LogLevel
+Endpoint
 ;%0Aimport
@@ -239,71 +239,8 @@
 or;%0A
-import com.aldoborrero.tinder.api.retrofit.TinderErrorHandler;%0A
 impo
@@ -278,16 +278,45 @@
 llable;%0A
+import retrofit.RestAdapter;%0A
 import r
@@ -490,32 +490,40 @@
 nderErrorHandler
+Listener
  errorHandler;%0A 
@@ -570,22 +570,28 @@
 private 
-Tind
+RestAdapt
 er
+.
 LogLevel
@@ -613,22 +613,28 @@
 private 
-Tind
+RestAdapt
 er
+.
 Log log;
@@ -739,32 +739,40 @@
 nderErrorHandler
+Listener
  errorHandler, T
@@ -795,22 +795,28 @@
 dpoint, 
-Tind
+RestAdapt
 er
+.
 LogLevel
@@ -826,22 +826,28 @@
 gLevel, 
-Tind
+RestAdapt
 er
+.
 Log log)
@@ -1331,16 +1331,24 @@
 rHandler
+Listener
  getErro
@@ -1446,16 +1446,24 @@
 rHandler
+Listener
  errorHa
@@ -1701,22 +1701,28 @@
  public 
-Tind
+RestAdapt
 er
+.
 LogLevel
@@ -1798,22 +1798,28 @@
 ogLevel(
-Tind
+RestAdapt
 er
+.
 LogLevel
@@ -1883,22 +1883,28 @@
  public 
-Tind
+RestAdapt
 er
+.
 Log getL
@@ -1960,22 +1960,28 @@
  setLog(
-Tind
+RestAdapt
 er
+.
 Log log)

Update the Setting class.