Skip to content
This repository was archived by the owner on Aug 28, 2025. It is now read-only.

Commit 7ca3c7c

Browse files
committed
Add optional parameter to support pagination in getTrayByType
1 parent 733f01d commit 7ca3c7c

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

CHANGES.md

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

3+
## 1.1.1
4+
* Add optional parameter to support pagination in getTrayByType
5+
36
## 1.1.0
47
* Get Categories (V1) is now fully depricated
58
* Added new Activities API - Assign to specific engagement the list of activities

src/com/Upwork/api/Routers/Mc.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@ public JSONObject getTrays() throws JSONException {
4848
public JSONObject getTrayByType(String username, String type) throws JSONException {
4949
return oClient.get("/mc/v1/trays/" + username + "/" + type);
5050
}
51+
52+
/**
53+
* Get tray by type
54+
*
55+
* @param username Username
56+
* @param type Tray type/name
57+
* @param params Parameters
58+
* @throws JSONException If error occurred
59+
* @return {@link JSONObject}
60+
*/
61+
public JSONObject getTrayByType(String username, String type, HashMap<String, String> params) throws JSONException {
62+
return oClient.get("/mc/v1/trays/" + username + "/" + type, params);
63+
}
5164

5265
/**
5366
* List thread details based on thread id

test/com/Upwork/api/Routers/McTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ public class McTest extends Helper {
2727

2828
@Test public void getTrayByType() throws Exception {
2929
Mc mc = new Mc(client);
30-
JSONObject json = mc.getTrayByType("username", "inbox");
30+
JSONObject json1 = mc.getTrayByType("username", "inbox");
31+
JSONObject json2 = mc.getTrayByType("username", "inbox", new HashMap<String, String>());
3132

32-
assertTrue(json instanceof JSONObject);
33+
assertTrue(json1 instanceof JSONObject);
34+
assertTrue(json2 instanceof JSONObject);
3335
}
3436

3537
@Test public void getThreadDetails() throws Exception {
@@ -77,4 +79,4 @@ public class McTest extends Helper {
7779

7880
assertTrue(json instanceof JSONObject);
7981
}
80-
}
82+
}

0 commit comments

Comments
 (0)