Skip to content

Commit

Permalink
Merge pull request #5 from upwork/v1.1.0
Browse files Browse the repository at this point in the history
V1.1.0
  • Loading branch information
mnovozhylov committed Oct 12, 2015
2 parents 4ae1706 + 298334e commit f9de4ee
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release History

## 1.1.0
* Get Categories (V1) is now fully depricated
* Added new Activities API - Assign to specific engagement the list of activities

## 1.0.2
* bug fixes

Expand Down
Binary file modified example-android/app/libs/java-upwork.jar
Binary file not shown.
Binary file modified lib/java-upwork.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>com.Upwork</groupId>
<artifactId>api</artifactId>
<version>1.0.1</version>
<version>1.1.0</version>
<packaging>jar</packaging>
<name>java-upwork</name>
<description>JAVA bindings for Upwork API</description>
Expand Down
20 changes: 16 additions & 4 deletions src/com/Upwork/api/Routers/Activities/Engagement.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
author = "Maksym Novozhylov <[email protected]>",
date = "6/4/2014",
currentRevision = 1,
lastModified = "6/4/2014",
lastModified = "24/09/2015",
lastModifiedBy = "Maksym Novozhylov",
reviewers = {"Yiota Tsakiri"}
)
Expand All @@ -43,12 +43,12 @@ public Engagement(OAuthClient client) {
oClient.setEntryPoint(ENTRY_POINT);
}

/**
/**
* List activities for specific engagement
*
* @param engagement_ref Engagement reference
* @throws JSONException If error occurred
* @return {@link JSONObject}
* @return {@link JSONObject}
*/
public JSONObject getSpecific(String engagement_ref) throws JSONException {
return oClient.get("/tasks/v2/tasks/contracts/" + engagement_ref);
Expand All @@ -62,10 +62,22 @@ public JSONObject getSpecific(String engagement_ref) throws JSONException {
* @param engagement Engagement
* @param params Parameters
* @throws JSONException If error occurred
* @return {@link JSONObject}
* @return {@link JSONObject}
*/
public JSONObject assign(String company, String team, String engagement, HashMap<String, String> params) throws JSONException {
return oClient.put("/otask/v1/tasks/companies/" + company + "/teams/" + team + "/engagements/" + engagement + "/tasks", params);
}

/**
* Assign engagements to the list of activities
*
* @param engagement_ref Engagement reference
* @param params Parameters
* @throws JSONException If error occurred
* @return {@link JSONObject}
*/
public JSONObject assignToEngagement(String engagement_ref, HashMap<String, String> params) throws JSONException {
return oClient.put("/tasks/v2/tasks/contracts/" + engagement_ref, params);
}

}
9 changes: 8 additions & 1 deletion test/com/Upwork/api/Routers/Activities/EngagementTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,11 @@ public class EngagementTest extends Helper {

assertTrue(json instanceof JSONObject);
}
}

@Test public void assignToEngagement() throws Exception {
Engagement activities = new Engagement(client);
JSONObject json = activities.assignToEngagement("1234", new HashMap<String, String>());

assertTrue(json instanceof JSONObject);
}
}

0 comments on commit f9de4ee

Please sign in to comment.