// Path: library/src/main/java/org/mariotaku/restfu/callback/Callback.java
// public interface Callback<T, E extends Exception> {
//     void result(@NotNull T result) throws E, IOException;
// 
//     void error(@NotNull E exception);
// }
// 
// Path: library/src/main/java/org/mariotaku/restfu/callback/RawCallback.java
// public interface RawCallback<E extends Exception> extends Callback<HttpResponse, E> {
// 
// }


import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.mariotaku.restfu.callback.Callback;
import org.mariotaku.restfu.callback.RawCallback;
import org.mariotaku.restfu.http.*;
import java.io.IOException;
import java.lang.reflect.*;
        @Override
        public Endpoint getEndpoint() {
            return endpoint;
        }

        @Override
        public RestHttpClient getRestClient() {
            return restClient;
        }

        @Override
        public Authorization getAuthorization() {
            return authorization;
        }

        @SuppressWarnings({"TryWithIdenticalCatches"})
        @Override
        public Object invoke(final Object proxy, final Method method, final Object[] args) throws E {
            try {
                if (method.getDeclaringClass() == Object.class) {
                    return method.invoke(this, args);
                } else if (method.getDeclaringClass() == RestClient.class) {
                    return method.invoke(this, args);
                }
            } catch (InvocationTargetException e) {
                throw new RuntimeException(e);
            } catch (IllegalAccessException e) {
                throw new RuntimeException(e);
            }
            final RestMethod<E> restMethod = RestMethod.get(method, args);
// Path: library/src/main/java/org/mariotaku/restfu/callback/Callback.java
// public interface Callback<T, E extends Exception> {
//     void result(@NotNull T result) throws E, IOException;
// 
//     void error(@NotNull E exception);
// }
// 
// Path: library/src/main/java/org/mariotaku/restfu/callback/RawCallback.java
// public interface RawCallback<E extends Exception> extends Callback<HttpResponse, E> {
// 
// }


// Path: library/src/main/java/org/mariotaku/restfu/RestAPIFactory.java
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.mariotaku.restfu.callback.Callback;
import org.mariotaku.restfu.callback.RawCallback;
import org.mariotaku.restfu.http.*;
import java.io.IOException;
import java.lang.reflect.*;

        @Override
        public Endpoint getEndpoint() {
            return endpoint;
        }

        @Override
        public RestHttpClient getRestClient() {
            return restClient;
        }

        @Override
        public Authorization getAuthorization() {
            return authorization;
        }

        @SuppressWarnings({"TryWithIdenticalCatches"})
        @Override
        public Object invoke(final Object proxy, final Method method, final Object[] args) throws E {
            try {
                if (method.getDeclaringClass() == Object.class) {
                    return method.invoke(this, args);
                } else if (method.getDeclaringClass() == RestClient.class) {
                    return method.invoke(this, args);
                }
            } catch (InvocationTargetException e) {
                throw new RuntimeException(e);
            } catch (IllegalAccessException e) {
                throw new RuntimeException(e);
            }
            final RestMethod<E> restMethod = RestMethod.get(method, args);
            final Callback<?, E> callback = findCallback(args);