// Path: src/main/java/com/lob/exception/APIException.java
// public class APIException extends LobException {
// 
//     private static final long serialVersionUID = 1L;
// 
//     @JsonCreator
//     public APIException(@JsonProperty("error") final Map<String, Object> error) {
//         super((String)error.get("message"), (Integer)error.get("status_code"));
//     }
// 
// }
// 
// Path: src/main/java/com/lob/exception/AuthenticationException.java
// public class AuthenticationException extends LobException {
// 
//     private static final long serialVersionUID = 1L;
// 
//     public AuthenticationException(String message, Integer statusCode) {
//         super(message, statusCode);
//     }
// 
// }
// 
// Path: src/main/java/com/lob/exception/InvalidRequestException.java
// public class InvalidRequestException extends LobException {
//     
//     private static final long serialVersionUID = 1L;
// 
//     @JsonCreator
//     public InvalidRequestException(@JsonProperty("error") final Map<String, Object> error) {
//         super((String)error.get("message"), (Integer)error.get("status_code"));
//     }
// 
// }
// 
// Path: src/main/java/com/lob/exception/RateLimitException.java
// public class RateLimitException extends LobException {
// 
//     private static final long serialVersionUID = 1L;
// 
//     @JsonCreator
//     public RateLimitException(@JsonProperty("error") final Map<String, Object> error) {
//         super((String)error.get("message"), (Integer)error.get("status_code"));
//     }
// 
// }


import com.lob.exception.APIException;
import com.lob.exception.AuthenticationException;
import com.lob.exception.InvalidRequestException;
import com.lob.exception.RateLimitException;
import java.io.IOException;
import java.util.Map;
package com.lob.net;



public abstract class APIResource  {

    private static ResponseGetter responseGetter = new ResponseGetter();

    public static final String CHARSET = "UTF-8";

    public enum RequestMethod {
        GET, POST, DELETE
    }

    public enum RequestType {
        NORMAL, MULTIPART, JSON
    }

    public static <T> LobResponse<T> request(APIResource.RequestMethod method, APIResource.RequestType type,
                                             String url, Map<String, Object> params, Class<T> clazz,
                                             RequestOptions options) throws AuthenticationException, APIException, RateLimitException, InvalidRequestException, IOException {
        return responseGetter.request(method, url, params, clazz, type, options);
    }

    public static <T> LobResponse<T> request(APIResource.RequestMethod method, APIResource.RequestType type,
                                             String url, Map<String, Object> params, Map<String, Object> query, Class<T> clazz,
                                             RequestOptions options) throws AuthenticationException, APIException, RateLimitException, InvalidRequestException, IOException {
// Path: src/main/java/com/lob/exception/APIException.java
// public class APIException extends LobException {
// 
//     private static final long serialVersionUID = 1L;
// 
//     @JsonCreator
//     public APIException(@JsonProperty("error") final Map<String, Object> error) {
//         super((String)error.get("message"), (Integer)error.get("status_code"));
//     }
// 
// }
// 
// Path: src/main/java/com/lob/exception/AuthenticationException.java
// public class AuthenticationException extends LobException {
// 
//     private static final long serialVersionUID = 1L;
// 
//     public AuthenticationException(String message, Integer statusCode) {
//         super(message, statusCode);
//     }
// 
// }
// 
// Path: src/main/java/com/lob/exception/InvalidRequestException.java
// public class InvalidRequestException extends LobException {
//     
//     private static final long serialVersionUID = 1L;
// 
//     @JsonCreator
//     public InvalidRequestException(@JsonProperty("error") final Map<String, Object> error) {
//         super((String)error.get("message"), (Integer)error.get("status_code"));
//     }
// 
// }
// 
// Path: src/main/java/com/lob/exception/RateLimitException.java
// public class RateLimitException extends LobException {
// 
//     private static final long serialVersionUID = 1L;
// 
//     @JsonCreator
//     public RateLimitException(@JsonProperty("error") final Map<String, Object> error) {
//         super((String)error.get("message"), (Integer)error.get("status_code"));
//     }
// 
// }


// Path: src/main/java/com/lob/net/APIResource.java
import com.lob.exception.APIException;
import com.lob.exception.AuthenticationException;
import com.lob.exception.InvalidRequestException;
import com.lob.exception.RateLimitException;
import java.io.IOException;
import java.util.Map;

package com.lob.net;



public abstract class APIResource  {

    private static ResponseGetter responseGetter = new ResponseGetter();

    public static final String CHARSET = "UTF-8";

    public enum RequestMethod {
        GET, POST, DELETE
    }

    public enum RequestType {
        NORMAL, MULTIPART, JSON
    }

    public static <T> LobResponse<T> request(APIResource.RequestMethod method, APIResource.RequestType type,
                                             String url, Map<String, Object> params, Class<T> clazz,
                                             RequestOptions options) throws AuthenticationException, APIException, RateLimitException, InvalidRequestException, IOException {
        return responseGetter.request(method, url, params, clazz, type, options);
    }

    public static <T> LobResponse<T> request(APIResource.RequestMethod method, APIResource.RequestType type,
                                             String url, Map<String, Object> params, Map<String, Object> query, Class<T> clazz,
                                             RequestOptions options) throws AuthenticationException, APIException, RateLimitException, InvalidRequestException, IOException {
        return responseGetter.request(method, url, params, query, clazz, type, options);