diff --git a/src/com/oDesk/api/Routers/Activities/Team.java b/src/com/oDesk/api/Routers/Activities/Team.java index f381d27..646207c 100644 --- a/src/com/oDesk/api/Routers/Activities/Team.java +++ b/src/com/oDesk/api/Routers/Activities/Team.java @@ -138,4 +138,16 @@ public JSONObject unarchiveActivity(String company, String team, String code) th return oClient.put("/otask/v1/tasks/companies/" + company + "/teams/" + team + "/unarchive/" + code); } + /** + * Update a group of oTask/Activity records + * + * @param company Company ID + * @param params Parameters + * @throws JSONException If error occurred + * @return {@link JSONObject} + */ + public JSONObject updateBatch(String company, HashMap params) throws JSONException { + return oClient.put("/otask/v1/tasks/companies/" + company + "/tasks/batch", params); + } + } diff --git a/src/com/oDesk/api/Routers/Freelancers/Profile.java b/src/com/oDesk/api/Routers/Freelancers/Profile.java index 453eb65..40bb89f 100644 --- a/src/com/oDesk/api/Routers/Freelancers/Profile.java +++ b/src/com/oDesk/api/Routers/Freelancers/Profile.java @@ -4,7 +4,7 @@ * Licensed under the oDesk's API Terms of Use; * you may not use this file except in compliance with the Terms. * You may obtain a copy of the Terms at - * + * * http://developers.odesk.com/API-Terms-of-Use * * Unless required by applicable law or agreed to in writing, software @@ -31,25 +31,35 @@ reviewers = {"Yiota Tsakiri"} ) public final class Profile { - + final static String ENTRY_POINT = "api"; - + private OAuthClient oClient = null; public Profile(OAuthClient client) { oClient = client; oClient.setEntryPoint(ENTRY_POINT); } - - /** + + /** * Get specific Freelancer's Profile * * @param key Profile key * @throws JSONException If error occurred * @return {@link JSONObject} */ - public JSONObject getSpecific(String key) throws JSONException { + public JSONObject getSpecific(String key) throws JSONException { return oClient.get("/profiles/v1/providers/" + key); } + /** + * Get brief info for the specific Freelancer's Profile + * + * @param key Profile key + * @throws JSONException If error occurred + * @return {@link JSONObject} + */ + public JSONObject getSpecificBrief(String key) throws JSONException { + return oClient.get("/profiles/v1/providers/" + key + "/brief"); + } } diff --git a/src/com/oDesk/api/Routers/Mc.java b/src/com/oDesk/api/Routers/Mc.java index 493d697..916b749 100644 --- a/src/com/oDesk/api/Routers/Mc.java +++ b/src/com/oDesk/api/Routers/Mc.java @@ -62,7 +62,7 @@ public JSONObject getThreadDetails(String username, String threadId) throws JSON } /** - * Get a specific thread by context + * Get a specific thread by "Interview" context * * @param username Username * @param jobKey Job key diff --git a/test/com/oDesk/api/Routers/Activities/TeamTest.java b/test/com/oDesk/api/Routers/Activities/TeamTest.java index 09f76b1..4d59736 100644 --- a/test/com/oDesk/api/Routers/Activities/TeamTest.java +++ b/test/com/oDesk/api/Routers/Activities/TeamTest.java @@ -21,41 +21,49 @@ public class TeamTest extends Helper { @Test public void getList() throws Exception { Team activities = new Team(client); JSONObject json = activities.getList("company", "team"); - + assertTrue(json instanceof JSONObject); } - + @Test public void getSpecificList() throws Exception { Team activities = new Team(client); JSONObject json = activities.getSpecificList("company", "team", "code"); assertTrue(json instanceof JSONObject); } - + @Test public void addActivity() throws Exception { Team activities = new Team(client); JSONObject json = activities.addActivity("company", "team", new HashMap()); - + assertTrue(json instanceof JSONObject); } - + @Test public void updateActivity() throws Exception { Team activities = new Team(client); JSONObject json = activities.updateActivity("company", "team", "code", new HashMap()); - + assertTrue(json instanceof JSONObject); } - + @Test public void archiveActivity() throws Exception { Team activities = new Team(client); JSONObject json = activities.archiveActivity("company", "team", "code"); - + assertTrue(json instanceof JSONObject); } - + @Test public void unarchiveActivity() throws Exception { Team activities = new Team(client); JSONObject json = activities.unarchiveActivity("company", "team", "code"); - + assertTrue(json instanceof JSONObject); } + + @Test public void updateBatch() throws Exception { + Team activities = new Team(client); + JSONObject json = activities.updateBatch("company", new HashMap()); + + assertTrue(json instanceof JSONObject); + } + } diff --git a/test/com/oDesk/api/Routers/Freelancers/ProfileTest.java b/test/com/oDesk/api/Routers/Freelancers/ProfileTest.java index 852b690..14622f3 100644 --- a/test/com/oDesk/api/Routers/Freelancers/ProfileTest.java +++ b/test/com/oDesk/api/Routers/Freelancers/ProfileTest.java @@ -19,7 +19,14 @@ public class ProfileTest extends Helper { @Test public void getSpecific() throws Exception { Profile profile = new Profile(client); JSONObject json = profile.getSpecific("key"); - + + assertTrue(json instanceof JSONObject); + } + + @Test public void getSpecificBrief() throws Exception { + Profile profile = new Profile(client); + JSONObject json = profile.getSpecificBrief("key"); + assertTrue(json instanceof JSONObject); } -} \ No newline at end of file +}