This repository was archived by the owner on Oct 9, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +38
-0
lines changed
src/com/oDesk/api/Routers/Hr
test/com/oDesk/api/Routers/Hr Expand file tree Collapse file tree 5 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 1
1
# Release History
2
2
3
3
## 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
4
6
* Added new Milestone API - Create a new Milestone
5
7
* Added new Milestone API - Edit the Milestone
6
8
* Added new Milestone API - Approve the Milestone
Original file line number Diff line number Diff line change @@ -43,6 +43,28 @@ public Milestones(OAuthClient client) {
43
43
oClient .setEntryPoint (ENTRY_POINT );
44
44
}
45
45
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
+
46
68
/**
47
69
* Create a new Milestone
48
70
*
Original file line number Diff line number Diff line change 18
18
Milestones .class
19
19
})
20
20
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
+
21
35
@ Test public void create () throws Exception {
22
36
Milestones milestones = new Milestones (client );
23
37
JSONObject json = milestones .create (new HashMap <String , String >());
You can’t perform that action at this time.
0 commit comments