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

Commit 82518a0

Browse files
authored
Merge pull request #16 from upwork/v1.2.3
v1.3.0
2 parents 4618b3c + 9a31ea8 commit 82518a0

File tree

13 files changed

+24
-183
lines changed

13 files changed

+24
-183
lines changed

.tests

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ant test

CHANGES.md

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

3+
## 1.3.0
4+
* Stop supporting deprecated Teamrooms API
5+
* Migrate Workdiaries, Workdays and Snapshots API to v3
6+
37
## 1.2.2
48
* Fix wrong method usage in updateRoomSettings and updateRoomMetadata
59

doc/java-upwork-javadoc.zip

-188 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

lib/java-upwork.jar

-45.3 KB
Binary file not shown.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>com.Upwork</groupId>
55
<artifactId>api</artifactId>
6-
<version>1.2.2</version>
6+
<version>1.3.0</version>
77
<packaging>jar</packaging>
88
<name>java-upwork</name>
99
<description>JAVA bindings for Upwork API</description>

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

Lines changed: 7 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
author = "Maksym Novozhylov <[email protected]>",
2929
date = "6/4/2014",
3030
currentRevision = 1,
31-
lastModified = "6/4/2014",
31+
lastModified = "24/5/2014",
3232
lastModifiedBy = "Maksym Novozhylov",
3333
reviewers = {"Yiota Tsakiri"}
3434
)
@@ -43,56 +43,16 @@ public Snapshot(OAuthClient client) {
4343
oClient.setEntryPoint(ENTRY_POINT);
4444
}
4545

46-
/**
47-
* Get snapshot info
48-
*
49-
* @param company Company
50-
* @param username Username
51-
* @param ts Timestamp
52-
* @throws JSONException If error occurred
53-
* @return {@link JSONObject}
54-
*/
55-
public JSONObject get(String company, String username, String ts) throws JSONException {
56-
return oClient.get("/team/v1/snapshots/" + company + "/" + username + "/" + ts);
57-
}
58-
59-
/**
60-
* Update snapshot
61-
*
62-
* @param company Company
63-
* @param username Username
64-
* @param ts Timestamp
65-
* @param params Parameters
66-
* @throws JSONException If error occurred
67-
* @return {@link JSONObject}
68-
*/
69-
public JSONObject update(String company, String username, String ts, HashMap<String, String> params) throws JSONException {
70-
return oClient.put("/team/v1/snapshots/" + company + "/" + username + "/" + ts, params);
71-
}
72-
73-
/**
74-
* Delete snapshot
75-
*
76-
* @param company Company
77-
* @param username Username
78-
* @param ts Timestamp
79-
* @throws JSONException If error occurred
80-
* @return {@link JSONObject}
81-
*/
82-
public JSONObject delete(String company, String username, String ts) throws JSONException {
83-
return oClient.delete("/team/v1/snapshots/" + company + "/" + username + "/" + ts);
84-
}
85-
8646
/**
8747
* Get snapshot info by specific contract
8848
*
8949
* @param contractId Contract ID
9050
* @param ts Timestamp
9151
* @throws JSONException If error occurred
92-
* @return {@link JSONObject}
52+
* @return {@link JSONObject}
9353
*/
9454
public JSONObject getByContract(String contractId, String ts) throws JSONException {
95-
return oClient.get("/team/v2/snapshots/contracts/" + contractId + "/" + ts);
55+
return oClient.get("/team/v3/snapshots/contracts/" + contractId + "/" + ts);
9656
}
9757

9858
/**
@@ -102,10 +62,10 @@ public JSONObject getByContract(String contractId, String ts) throws JSONExcepti
10262
* @param ts Timestamp
10363
* @param params Parameters
10464
* @throws JSONException If error occurred
105-
* @return {@link JSONObject}
65+
* @return {@link JSONObject}
10666
*/
10767
public JSONObject updateByContract(String contractId, String ts, HashMap<String, String> params) throws JSONException {
108-
return oClient.put("/team/v2/snapshots/contracts/" + contractId + "/" + ts, params);
68+
return oClient.put("/team/v3/snapshots/contracts/" + contractId + "/" + ts, params);
10969
}
11070

11171
/**
@@ -114,10 +74,10 @@ public JSONObject updateByContract(String contractId, String ts, HashMap<String,
11474
* @param contractId Contract ID
11575
* @param ts Timestamp
11676
* @throws JSONException If error occurred
117-
* @return {@link JSONObject}
77+
* @return {@link JSONObject}
11878
*/
11979
public JSONObject deleteByContract(String contractId, String ts) throws JSONException {
120-
return oClient.delete("/team/v2/snapshots/contracts/" + contractId + "/" + ts);
80+
return oClient.delete("/team/v3/snapshots/contracts/" + contractId + "/" + ts);
12181
}
12282

12383
}

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

Lines changed: 0 additions & 68 deletions
This file was deleted.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
author = "Maksym Novozhylov <[email protected]>",
2929
date = "14/7/2015",
3030
currentRevision = 1,
31-
lastModified = "14/7/2015",
31+
lastModified = "24/5/2018",
3232
lastModifiedBy = "Maksym Novozhylov",
3333
reviewers = {"Yiota Tsakiri"}
3434
)
@@ -54,7 +54,7 @@ public Workdays(OAuthClient client) {
5454
* @return {@link JSONObject}
5555
*/
5656
public JSONObject getByCompany(String company, String fromDate, String tillDate, HashMap<String, String> params) throws JSONException {
57-
return oClient.get("/team/v2/workdays/companies/" + company + "/" + fromDate + "," + tillDate, params);
57+
return oClient.get("/team/v3/workdays/companies/" + company + "/" + fromDate + "," + tillDate, params);
5858
}
5959

6060
/**
@@ -68,7 +68,7 @@ public JSONObject getByCompany(String company, String fromDate, String tillDate,
6868
* @return {@link JSONObject}
6969
*/
7070
public JSONObject getByContract(String contract, String fromDate, String tillDate, HashMap<String, String> params) throws JSONException {
71-
return oClient.get("/team/v2/workdays/contracts/" + contract + "/" + fromDate + "," + tillDate, params);
71+
return oClient.get("/team/v3/workdays/contracts/" + contract + "/" + fromDate + "," + tillDate, params);
7272
}
7373

74-
}
74+
}

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
author = "Maksym Novozhylov <[email protected]>",
2929
date = "6/3/2014",
3030
currentRevision = 1,
31-
lastModified = "6/3/2014",
31+
lastModified = "24/5/2018",
3232
lastModifiedBy = "Maksym Novozhylov",
3333
reviewers = {"Yiota Tsakiri"}
3434
)
@@ -47,14 +47,13 @@ public Workdiary(OAuthClient client) {
4747
* Get Workdiary
4848
*
4949
* @param company Company ID
50-
* @param username User ID
5150
* @param date Date
5251
* @param params (Optional) Parameters
5352
* @throws JSONException If error occurred
5453
* @return {@link JSONObject}
5554
*/
56-
public JSONObject get(String company, String username, String date, HashMap<String, String> params) throws JSONException {
57-
return oClient.get("/team/v1/workdiaries/" + company + "/" + username + "/" + date, params);
55+
public JSONObject get(String company, String date, HashMap<String, String> params) throws JSONException {
56+
return oClient.get("/team/v3/workdiaries/companies/" + company + "/" + date, params);
5857
}
5958

6059
/**
@@ -67,7 +66,7 @@ public JSONObject get(String company, String username, String date, HashMap<Stri
6766
* @return {@link JSONObject}
6867
*/
6968
public JSONObject getByContract(String contract, String date, HashMap<String, String> params) throws JSONException {
70-
return oClient.get("/team/v2/workdiaries/contracts/" + contract + "/" + date, params);
69+
return oClient.get("/team/v3/workdiaries/contracts/" + contract + "/" + date, params);
7170
}
7271

7372
}

0 commit comments

Comments
 (0)