Skip to content
This repository was archived by the owner on Oct 9, 2018. It is now read-only.

Commit 33d2183

Browse files
author
Maksym Novozhylov
committed
Additions to version 0.1.11
1 parent ceeb2d5 commit 33d2183

File tree

5 files changed

+38
-0
lines changed

5 files changed

+38
-0
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Release History
22

33
## 0.1.11
4+
* Added new Milestone API - Get Active Milestone for specific Contract
5+
* Added new Milestone API - Get all Submissions for specific Milestone
46
* Added new Milestone API - Create a new Milestone
57
* Added new Milestone API - Edit the Milestone
68
* Added new Milestone API - Approve the Milestone
102 Bytes
Binary file not shown.

lib/java-odesk.jar

102 Bytes
Binary file not shown.

src/com/oDesk/api/Routers/Hr/Milestones.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,28 @@ public Milestones(OAuthClient client) {
4343
oClient.setEntryPoint(ENTRY_POINT);
4444
}
4545

46+
/**
47+
* Get active Milestone for the Contract
48+
*
49+
* @param contractId Contract reference
50+
* @throws JSONException If error occurred
51+
* @return {@link JSONObject}
52+
*/
53+
public JSONObject getActiveMilestone(String contractId) throws JSONException {
54+
return oClient.get("/hr/v3/fp/milestones/statuses/active/contracts/" + contractId);
55+
}
56+
57+
/**
58+
* Get all submissions for the active Milestone
59+
*
60+
* @param milestoneId Milestone ID
61+
* @throws JSONException If error occurred
62+
* @return {@link JSONObject}
63+
*/
64+
public JSONObject getSubmissions(String milestoneId) throws JSONException {
65+
return oClient.get("/hr/v3/fp/milestones/" + milestoneId + "/submissions");
66+
}
67+
4668
/**
4769
* Create a new Milestone
4870
*

test/com/oDesk/api/Routers/Hr/MilestonesTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@
1818
Milestones.class
1919
})
2020
public class MilestonesTest extends Helper {
21+
@Test public void getActiveMilestone() throws Exception {
22+
Milestones milestones = new Milestones(client);
23+
JSONObject json = milestones.getActiveMilestone("1234");
24+
25+
assertTrue(json instanceof JSONObject);
26+
}
27+
28+
@Test public void getSubmissions() throws Exception {
29+
Milestones milestones = new Milestones(client);
30+
JSONObject json = milestones.getSubmissions("1234");
31+
32+
assertTrue(json instanceof JSONObject);
33+
}
34+
2135
@Test public void create() throws Exception {
2236
Milestones milestones = new Milestones(client);
2337
JSONObject json = milestones.create(new HashMap<String, String>());

0 commit comments

Comments
 (0)