// Path: src/main/java/net/joelinn/asana/AbstractClient.java
// public abstract class AbstractClient {
//     public static final String BASE_URL = "https://app.asana.com/api/1.0/";
// 
//     protected String apiKey;
// 
//     protected WebResource service;
// 
//     public AbstractClient(String apiKey){
//         this(apiKey, 0, 0);
//     }
// 
//     /**
//      * @param apiKey your Asana API key
//      * @param connectionTimeout the connection timeout in MILLISECONDS
//      * @param readTimeout the read timeout in MILLISECONDS
//      */
//     public AbstractClient(String apiKey, int connectionTimeout, int readTimeout){
//         this.apiKey = apiKey;
// 
//         ClientConfig config = new DefaultClientConfig();
//         ObjectMapper mapper = new ObjectMapper();
//         mapper.configure(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE, true);
//         mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
//         JacksonJsonProvider provider = new JacksonJsonProvider(mapper);
//         config.getSingletons().add(provider);
//         //config.getClasses().add(JacksonJsonProvider.class);
//         Client client = Client.create(config);
//         client.addFilter(new HTTPBasicAuthFilter(apiKey, ""));
//         client.setConnectTimeout(connectionTimeout);
//         client.setReadTimeout(readTimeout);
//         service = client.resource(UriBuilder.fromUri(BASE_URL).build());
//     }
// 
//     protected ClientResponse get(String url){
//         return get(url, null);
//     }
// 
//     protected ClientResponse get(String url, MultivaluedMapImpl queryParams){
//         return request("GET", url, queryParams);
//     }
// 
//     protected ClientResponse post(String url, MultivaluedMapImpl data){
//         return request("POST", url, null, data);
//     }
// 
//     protected ClientResponse put(String url, MultivaluedMapImpl data){
//         return request("PUT", url, null, data);
//     }
// 
//     protected ClientResponse delete(String url){
//         return request("DELETE", url);
//     }
// 
//     protected ClientResponse request(String method, String url){
//         return request(method, url, null);
//     }
// 
//     protected ClientResponse request(String method, String url, MultivaluedMapImpl queryParams){
//         return request(method, url, queryParams, null);
//     }
// 
//     protected ClientResponse request(String method, String url, MultivaluedMapImpl queryParams, MultivaluedMapImpl data){
//         ClientResponse clientResponse = getResourceBuilder(url, queryParams).method(method, ClientResponse.class, data);
//         checkForErrors(clientResponse);
//         return clientResponse;
//     }
// 
//     private void checkForErrors(ClientResponse clientResponse){
//         if(clientResponse.getClientResponseStatus().getStatusCode() != ClientResponse.Status.OK.getStatusCode()
//                 && clientResponse.getClientResponseStatus().getStatusCode() != ClientResponse.Status.CREATED.getStatusCode()){
//             throw new ApiException(clientResponse.getClientResponseStatus(), clientResponse.getEntity(Errors.class).get(0).message);
//         }
//     }
// 
//     private WebResource.Builder getResourceBuilder(String url, MultivaluedMapImpl queryParams){
//         WebResource webResource = service.path(url);
//         if(queryParams != null){
//             webResource = webResource.queryParams(queryParams);
//         }
//         return webResource.accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_FORM_URLENCODED);
//     }
// }
// 
// Path: src/main/java/net/joelinn/asana/projects/Projects.java
// @JsonRootName("data")
// public class Projects extends ArrayList<Project>{
// }
// 
// Path: src/main/java/net/joelinn/asana/stories/Stories.java
// @JsonRootName("data")
// public class Stories extends ArrayList<Story>{
// }
// 
// Path: src/main/java/net/joelinn/asana/stories/Story.java
// @JsonRootName("data")
// public class Story {
//     public long id;
// 
//     @JsonProperty("created_at")
//     public Date createdAt;
// 
//     @JsonProperty("created_by")
//     public User createdBy;
// 
//     public String text;
//     public Task target;
//     public String source;
//     public String type;
//     
//     public boolean hearted;
//     
//     public Users hearts;
//     
//     @JsonProperty("num_hearts")
//     public Integer numHearts;
// }
// 
// Path: src/main/java/net/joelinn/asana/tags/Tags.java
// @JsonRootName("data")
// public class Tags extends ArrayList<Tag>{
// }


import com.sun.jersey.core.util.MultivaluedMapImpl;
import net.joelinn.asana.AbstractClient;
import net.joelinn.asana.projects.Projects;
import net.joelinn.asana.stories.Stories;
import net.joelinn.asana.stories.Story;
import net.joelinn.asana.tags.Tags;
package net.joelinn.asana.tasks;


/**
 * Joe Linn
 * 11/17/13
 * @see <a href="http://developer.asana.com/documentation/#tasks">http://developer.asana.com/documentation/#tasks</a>
 */
public class TasksClient extends AbstractClient{
    public TasksClient(String apiKey) {
        super(apiKey);
    }

    /**
     * @param apiKey            your Asana API key
     * @param connectionTimeout the connection timeout in MILLISECONDS
     * @param readTimeout       the read timeout in MILLISECONDS
     */
    public TasksClient(String apiKey, int connectionTimeout, int readTimeout) {
// Path: src/main/java/net/joelinn/asana/AbstractClient.java
// public abstract class AbstractClient {
//     public static final String BASE_URL = "https://app.asana.com/api/1.0/";
// 
//     protected String apiKey;
// 
//     protected WebResource service;
// 
//     public AbstractClient(String apiKey){
//         this(apiKey, 0, 0);
//     }
// 
//     /**
//      * @param apiKey your Asana API key
//      * @param connectionTimeout the connection timeout in MILLISECONDS
//      * @param readTimeout the read timeout in MILLISECONDS
//      */
//     public AbstractClient(String apiKey, int connectionTimeout, int readTimeout){
//         this.apiKey = apiKey;
// 
//         ClientConfig config = new DefaultClientConfig();
//         ObjectMapper mapper = new ObjectMapper();
//         mapper.configure(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE, true);
//         mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
//         JacksonJsonProvider provider = new JacksonJsonProvider(mapper);
//         config.getSingletons().add(provider);
//         //config.getClasses().add(JacksonJsonProvider.class);
//         Client client = Client.create(config);
//         client.addFilter(new HTTPBasicAuthFilter(apiKey, ""));
//         client.setConnectTimeout(connectionTimeout);
//         client.setReadTimeout(readTimeout);
//         service = client.resource(UriBuilder.fromUri(BASE_URL).build());
//     }
// 
//     protected ClientResponse get(String url){
//         return get(url, null);
//     }
// 
//     protected ClientResponse get(String url, MultivaluedMapImpl queryParams){
//         return request("GET", url, queryParams);
//     }
// 
//     protected ClientResponse post(String url, MultivaluedMapImpl data){
//         return request("POST", url, null, data);
//     }
// 
//     protected ClientResponse put(String url, MultivaluedMapImpl data){
//         return request("PUT", url, null, data);
//     }
// 
//     protected ClientResponse delete(String url){
//         return request("DELETE", url);
//     }
// 
//     protected ClientResponse request(String method, String url){
//         return request(method, url, null);
//     }
// 
//     protected ClientResponse request(String method, String url, MultivaluedMapImpl queryParams){
//         return request(method, url, queryParams, null);
//     }
// 
//     protected ClientResponse request(String method, String url, MultivaluedMapImpl queryParams, MultivaluedMapImpl data){
//         ClientResponse clientResponse = getResourceBuilder(url, queryParams).method(method, ClientResponse.class, data);
//         checkForErrors(clientResponse);
//         return clientResponse;
//     }
// 
//     private void checkForErrors(ClientResponse clientResponse){
//         if(clientResponse.getClientResponseStatus().getStatusCode() != ClientResponse.Status.OK.getStatusCode()
//                 && clientResponse.getClientResponseStatus().getStatusCode() != ClientResponse.Status.CREATED.getStatusCode()){
//             throw new ApiException(clientResponse.getClientResponseStatus(), clientResponse.getEntity(Errors.class).get(0).message);
//         }
//     }
// 
//     private WebResource.Builder getResourceBuilder(String url, MultivaluedMapImpl queryParams){
//         WebResource webResource = service.path(url);
//         if(queryParams != null){
//             webResource = webResource.queryParams(queryParams);
//         }
//         return webResource.accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_FORM_URLENCODED);
//     }
// }
// 
// Path: src/main/java/net/joelinn/asana/projects/Projects.java
// @JsonRootName("data")
// public class Projects extends ArrayList<Project>{
// }
// 
// Path: src/main/java/net/joelinn/asana/stories/Stories.java
// @JsonRootName("data")
// public class Stories extends ArrayList<Story>{
// }
// 
// Path: src/main/java/net/joelinn/asana/stories/Story.java
// @JsonRootName("data")
// public class Story {
//     public long id;
// 
//     @JsonProperty("created_at")
//     public Date createdAt;
// 
//     @JsonProperty("created_by")
//     public User createdBy;
// 
//     public String text;
//     public Task target;
//     public String source;
//     public String type;
//     
//     public boolean hearted;
//     
//     public Users hearts;
//     
//     @JsonProperty("num_hearts")
//     public Integer numHearts;
// }
// 
// Path: src/main/java/net/joelinn/asana/tags/Tags.java
// @JsonRootName("data")
// public class Tags extends ArrayList<Tag>{
// }


// Path: src/main/java/net/joelinn/asana/tasks/TasksClient.java
import com.sun.jersey.core.util.MultivaluedMapImpl;
import net.joelinn.asana.AbstractClient;
import net.joelinn.asana.projects.Projects;
import net.joelinn.asana.stories.Stories;
import net.joelinn.asana.stories.Story;
import net.joelinn.asana.tags.Tags;

package net.joelinn.asana.tasks;


/**
 * Joe Linn
 * 11/17/13
 * @see <a href="http://developer.asana.com/documentation/#tasks">http://developer.asana.com/documentation/#tasks</a>
 */
public class TasksClient extends AbstractClient{
    public TasksClient(String apiKey) {
        super(apiKey);
    }

    /**
     * @param apiKey            your Asana API key
     * @param connectionTimeout the connection timeout in MILLISECONDS
     * @param readTimeout       the read timeout in MILLISECONDS
     */
    public TasksClient(String apiKey, int connectionTimeout, int readTimeout) {
        super(apiKey, connectionTimeout, readTimeout);