// Path: src/main/java/net/joelinn/asana/ApiException.java
// public class ApiException extends RuntimeException{
//     protected ClientResponse.Status status;
//     protected String message;
// 
//     public ApiException(ClientResponse.Status status, String message){
//         super(message);
//         this.status = status;
//         this.message = message;
//     }
// 
//     public ClientResponse.Status getStatus(){
//         return status;
//     }
// 
//     @Override
//     public String toString() {
//         String s = getClass().getName();
//         String message = getLocalizedMessage();
//         return String.format("%s: %s %s", s, status.getStatusCode(), message);
//     }
// }
// 
// Path: src/main/java/net/joelinn/asana/projects/Project.java
// @JsonRootName("data")
// public class Project {
//     public long id;
//     public boolean archived;
// 
//     @JsonProperty("created_at")
//     public String createdAt;
// 
//     public Users followers;
// 
//     @JsonProperty("modified_at")
//     public String modifiedAt;
// 
//     public String name;
//     public String color;
//     public String notes;
//     public Workspace workspace;
//     public Team team;
//     public Users members;
// 
//     @JsonProperty("public")
//     public boolean isPublic;
// }
// 
// Path: src/main/java/net/joelinn/asana/projects/ProjectRequestBuilder.java
// public class ProjectRequestBuilder {
//     MultivaluedMapImpl params = new MultivaluedMapImpl();
// 
//     public ProjectRequestBuilder(){
// 
//     }
// 
//     public ProjectRequestBuilder(long workspaceId, String name){
//         workspace(workspaceId).name(name);
//     }
// 
//     public ProjectRequestBuilder name(String name){
//         params.add("name", name);
//         return this;
//     }
// 
//     public ProjectRequestBuilder notes(String notes){
//         params.add("notes", notes);
//         return this;
//     }
// 
//     public ProjectRequestBuilder workspace(long workspaceId){
//         params.add("workspace", workspaceId);
//         return this;
//     }
// 
//     public ProjectRequestBuilder team(long teamId){
//         params.add("team", teamId);
//         return this;
//     }
// 
//     public ProjectRequestBuilder archived(boolean archived){
//         params.add("archived", archived);
//         return this;
//     }
// 
//     public ProjectRequestBuilder color(String color){
//         params.add("color", color);
//         return this;
//     }
// 
//     public MultivaluedMapImpl build(){
//         return params;
//     }
// }
// 
// Path: src/main/java/net/joelinn/asana/projects/ProjectsClient.java
// public class ProjectsClient extends AbstractClient{
//     public ProjectsClient(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 ProjectsClient(String apiKey, int connectionTimeout, int readTimeout) {
//         super(apiKey, connectionTimeout, readTimeout);
//     }
// 
//     public Project createProject(ProjectRequestBuilder builder){
//         return post("", builder.build()).getEntity(Project.class);
//     }
// 
//     public Project updateProject(long projectId, ProjectRequestBuilder builder){
//         return put(Long.toString(projectId), builder.build()).getEntity(Project.class);
//     }
// 
//     public Project getProject(long projectId){
//         return get(Long.toString(projectId)).getEntity(Project.class);
//     }
// 
//     public void deleteProject(long projectId){
//         delete(Long.toString(projectId));
//     }
//  	
//     public Tasks getExpandedTasks (long projectId) {
//         MultivaluedMapImpl params = new MultivaluedMapImpl();
//         params.add("opt_expand", ".");
//         return get(String.format("%s/tasks", projectId), params).getEntity(Tasks.class);
//     }
// 
//     public Tasks getTasks(long projectId){
//         return get(String.format("%s/tasks", projectId)).getEntity(Tasks.class);
//     }
// 
//     public Projects getProjects(long workspaceId, boolean archived){
//         MultivaluedMapImpl params = new MultivaluedMapImpl();
//         params.add("workspace", workspaceId);
//         params.add("archvied", archived);
//         return get("", params).getEntity(Projects.class);
//     }
// 
//     @Override
//     protected ClientResponse request(String method, String url, MultivaluedMapImpl queryParams, MultivaluedMapImpl data) {
//         return super.request(method, "projects/" + url, queryParams, data);
//     }
// }
// 
// Path: src/test/java/net/joelinn/asana/test/BaseTest.java
// public abstract class BaseTest {
//     protected String getApiKey(){
//         return "";  //enter your api key here to run the tests
//     }
// }


import com.sun.jersey.api.client.ClientResponse;
import junit.framework.TestCase;
import net.joelinn.asana.ApiException;
import net.joelinn.asana.projects.Project;
import net.joelinn.asana.projects.ProjectRequestBuilder;
import net.joelinn.asana.projects.ProjectsClient;
import net.joelinn.asana.test.BaseTest;
import org.junit.Before;
import org.junit.Test;
package net.joelinn.asana.test.projects;


/**
 * Joe Linn
 * 11/20/13
 */
public class ProjectsClientTest extends BaseTest{
    protected ProjectsClient client;

    @Before
    public void setUp(){
        client = new ProjectsClient(getApiKey());
    }

    @Test
    public void testProjects(){
        if(getApiKey().equals("")){
            // skip the test if no api key has been provided
            return;
        }
// Path: src/main/java/net/joelinn/asana/ApiException.java
// public class ApiException extends RuntimeException{
//     protected ClientResponse.Status status;
//     protected String message;
// 
//     public ApiException(ClientResponse.Status status, String message){
//         super(message);
//         this.status = status;
//         this.message = message;
//     }
// 
//     public ClientResponse.Status getStatus(){
//         return status;
//     }
// 
//     @Override
//     public String toString() {
//         String s = getClass().getName();
//         String message = getLocalizedMessage();
//         return String.format("%s: %s %s", s, status.getStatusCode(), message);
//     }
// }
// 
// Path: src/main/java/net/joelinn/asana/projects/Project.java
// @JsonRootName("data")
// public class Project {
//     public long id;
//     public boolean archived;
// 
//     @JsonProperty("created_at")
//     public String createdAt;
// 
//     public Users followers;
// 
//     @JsonProperty("modified_at")
//     public String modifiedAt;
// 
//     public String name;
//     public String color;
//     public String notes;
//     public Workspace workspace;
//     public Team team;
//     public Users members;
// 
//     @JsonProperty("public")
//     public boolean isPublic;
// }
// 
// Path: src/main/java/net/joelinn/asana/projects/ProjectRequestBuilder.java
// public class ProjectRequestBuilder {
//     MultivaluedMapImpl params = new MultivaluedMapImpl();
// 
//     public ProjectRequestBuilder(){
// 
//     }
// 
//     public ProjectRequestBuilder(long workspaceId, String name){
//         workspace(workspaceId).name(name);
//     }
// 
//     public ProjectRequestBuilder name(String name){
//         params.add("name", name);
//         return this;
//     }
// 
//     public ProjectRequestBuilder notes(String notes){
//         params.add("notes", notes);
//         return this;
//     }
// 
//     public ProjectRequestBuilder workspace(long workspaceId){
//         params.add("workspace", workspaceId);
//         return this;
//     }
// 
//     public ProjectRequestBuilder team(long teamId){
//         params.add("team", teamId);
//         return this;
//     }
// 
//     public ProjectRequestBuilder archived(boolean archived){
//         params.add("archived", archived);
//         return this;
//     }
// 
//     public ProjectRequestBuilder color(String color){
//         params.add("color", color);
//         return this;
//     }
// 
//     public MultivaluedMapImpl build(){
//         return params;
//     }
// }
// 
// Path: src/main/java/net/joelinn/asana/projects/ProjectsClient.java
// public class ProjectsClient extends AbstractClient{
//     public ProjectsClient(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 ProjectsClient(String apiKey, int connectionTimeout, int readTimeout) {
//         super(apiKey, connectionTimeout, readTimeout);
//     }
// 
//     public Project createProject(ProjectRequestBuilder builder){
//         return post("", builder.build()).getEntity(Project.class);
//     }
// 
//     public Project updateProject(long projectId, ProjectRequestBuilder builder){
//         return put(Long.toString(projectId), builder.build()).getEntity(Project.class);
//     }
// 
//     public Project getProject(long projectId){
//         return get(Long.toString(projectId)).getEntity(Project.class);
//     }
// 
//     public void deleteProject(long projectId){
//         delete(Long.toString(projectId));
//     }
//  	
//     public Tasks getExpandedTasks (long projectId) {
//         MultivaluedMapImpl params = new MultivaluedMapImpl();
//         params.add("opt_expand", ".");
//         return get(String.format("%s/tasks", projectId), params).getEntity(Tasks.class);
//     }
// 
//     public Tasks getTasks(long projectId){
//         return get(String.format("%s/tasks", projectId)).getEntity(Tasks.class);
//     }
// 
//     public Projects getProjects(long workspaceId, boolean archived){
//         MultivaluedMapImpl params = new MultivaluedMapImpl();
//         params.add("workspace", workspaceId);
//         params.add("archvied", archived);
//         return get("", params).getEntity(Projects.class);
//     }
// 
//     @Override
//     protected ClientResponse request(String method, String url, MultivaluedMapImpl queryParams, MultivaluedMapImpl data) {
//         return super.request(method, "projects/" + url, queryParams, data);
//     }
// }
// 
// Path: src/test/java/net/joelinn/asana/test/BaseTest.java
// public abstract class BaseTest {
//     protected String getApiKey(){
//         return "";  //enter your api key here to run the tests
//     }
// }


// Path: src/test/java/net/joelinn/asana/test/projects/ProjectsClientTest.java
import com.sun.jersey.api.client.ClientResponse;
import junit.framework.TestCase;
import net.joelinn.asana.ApiException;
import net.joelinn.asana.projects.Project;
import net.joelinn.asana.projects.ProjectRequestBuilder;
import net.joelinn.asana.projects.ProjectsClient;
import net.joelinn.asana.test.BaseTest;
import org.junit.Before;
import org.junit.Test;

package net.joelinn.asana.test.projects;


/**
 * Joe Linn
 * 11/20/13
 */
public class ProjectsClientTest extends BaseTest{
    protected ProjectsClient client;

    @Before
    public void setUp(){
        client = new ProjectsClient(getApiKey());
    }

    @Test
    public void testProjects(){
        if(getApiKey().equals("")){
            // skip the test if no api key has been provided
            return;
        }
        Project project = client.createProject(new ProjectRequestBuilder(4440299545542L, "test project")