package com.creatubbles.api;

import com.creatubbles.api.core.Creation;
import com.creatubbles.api.core.Credentials;
import com.creatubbles.api.core.Gallery;
import com.creatubbles.api.request.amazon.GetAmazonTokenRequest;
import com.creatubbles.api.request.amazon.UploadS3ImageRequest;
import com.creatubbles.api.request.auth.SignInRequest;
import com.creatubbles.api.request.creation.UpdateCreationRequest;
import com.creatubbles.api.request.creation.UploadCreationRequest;
import com.creatubbles.api.response.amazon.GetAmazonTokenResponse;
import com.creatubbles.api.response.auth.SignInResponse;
import com.creatubbles.api.response.auth.SignUpResponse;
import com.creatubbles.api.response.creation.UploadCreationResponse;
import com.creatubbles.api.response.creator.CreateCreatorResponse;
import com.creatubbles.api.response.gallery.CreateUserGalleryResponse;
import com.creatubbles.api.response.user.UserProfileResponse;
import com.creatubbles.api.util.EndPoints;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.glassfish.jersey.client.ClientProperties;
import org.glassfish.jersey.client.JerseyClient;
import org.glassfish.jersey.client.JerseyClientBuilder;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;

public class CreatubblesAPI {
    public final static Gson GSON = new GsonBuilder()
            .registerTypeAdapter(SignUpResponse.class, new SignUpResponse())
            .registerTypeAdapter(UserProfileResponse.class, new UserProfileResponse())
            .registerTypeAdapter(CreateCreatorResponse.class, new CreateCreatorResponse())
            .registerTypeAdapter(CreateUserGalleryResponse.class, new CreateUserGalleryResponse())
            .registerTypeAdapter(CreateUserGalleryResponse.class, new CreateUserGalleryResponse())
            .registerTypeAdapter(Gallery.class, new Gallery())
            .create();

    public final static JerseyClient CLIENT = JerseyClientBuilder
            .createClient()
            .property(ClientProperties.CONNECT_TIMEOUT, 5000)
            .property(ClientProperties.READ_TIMEOUT, 5000);

    public static String buildURL(final String endPoint) {
        String base = staging ? EndPoints.URL_BASE_STAGING : EndPoints.URL_BASE;
        return base.concat(endPoint);
    }

    private static boolean staging = false;

    public static void setStagingMode(boolean staging) {
        CreatubblesAPI.staging = staging;
    }

}

@@ -34,687 +34,248 @@
 ort 
-com.creatubbles.api.core.Creation;%0Aimport com.creatubbles.api.core.Credentials;%0Aimport com.creatubbles.api.core.Gallery;%0Aimport com.creatubbles.api.request.amazon.GetAmazonTokenRequest;%0Aimport com.creatubbles.api.request.amazon.UploadS3ImageRequest;%0Aimport com.creatubbles.api.request.auth.SignInRequest;%0Aimport com.creatubbles.api.request.creation.UpdateCreationRequest;%0Aimport com.creatubbles.api.request.creation.UploadCreationRequest;%0Aimport com.creatubbles.api.response.amazon.GetAmazonTokenResponse;%0Aimport com.creatubbles.api.response.auth.SignInResponse;%0Aimport com.creatubbles.api.response.auth.SignUpResponse;%0Aimport com.creatubbles.api.response.creation.UploadCreation
+org.glassfish.jersey.client.ClientProperties;%0Aimport org.glassfish.jersey.client.JerseyClient;%0Aimport org.glassfish.jersey.client.JerseyClientBuilder;%0A%0Aimport com.creatubbles.api.core.Gallery;%0Aimport com.creatubbles.api.response.auth.SignUp
 Resp
@@ -591,244 +591,8 @@
 der;
-%0Aimport org.glassfish.jersey.client.ClientProperties;%0Aimport org.glassfish.jersey.client.JerseyClient;%0Aimport org.glassfish.jersey.client.JerseyClientBuilder;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.nio.file.Files;
 %0A%0Apu

Remove unused imports