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

Commit 5e090ce

Browse files
authored
Merge pull request #7 from upwork/v1.2.2
v1.3.0
2 parents 48e386f + 778a2af commit 5e090ce

File tree

4 files changed

+15
-26
lines changed

4 files changed

+15
-26
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.3.0
2+
* Stop supporting deprecated Teamrooms API
3+
* Migrate Workdiaries, Workdays and Snapshots API to v3
4+
15
## 1.2.1
26
* Applications API has moved from v3 to v4
37

api/routers/snapshot/snapshot.go

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,32 +36,17 @@ func New(c api.ApiClient) (a) {
3636
return r
3737
}
3838

39-
// Get snapshot info
40-
func (r a) Get(company string, username string, ts string) (*http.Response, []byte) {
41-
return r.client.Get("/team/v1/snapshots/" + company + "/" + username + "/" + ts, nil)
42-
}
43-
44-
// Update snapshot
45-
func (r a) Update(company string, username string, ts string, params map[string]string) (*http.Response, []byte) {
46-
return r.client.Post("/team/v1/snapshots/" + company + "/" + username + "/" + ts, params)
47-
}
48-
49-
// Delete snapshot
50-
func (r a) Delete(company string, username string, ts string) (*http.Response, []byte) {
51-
return r.client.Delete("/team/v1/snapshots/" + company + "/" + username + "/" + ts, nil)
52-
}
53-
5439
// Get snapshot info by specific contract
5540
func (r a) GetByContract(contractId string, ts string) (*http.Response, []byte) {
56-
return r.client.Get("/team/v2/snapshots/contracts/" + contractId + "/" + ts, nil)
41+
return r.client.Get("/team/v3/snapshots/contracts/" + contractId + "/" + ts, nil)
5742
}
5843

5944
// Update snapshot by specific contract
6045
func (r a) UpdateByContract(contractId string, ts string, params map[string]string) (*http.Response, []byte) {
61-
return r.client.Post("/team/v2/snapshots/contracts/" + contractId + "/" + ts, params)
46+
return r.client.Post("/team/v3/snapshots/contracts/" + contractId + "/" + ts, params)
6247
}
6348

6449
// Delete snapshot by specific contract
6550
func (r a) DeleteByContract(contractId string, ts string) (*http.Response, []byte) {
66-
return r.client.Delete("/team/v2/snapshots/contracts/" + contractId + "/" + ts, nil)
67-
}
51+
return r.client.Delete("/team/v3/snapshots/contracts/" + contractId + "/" + ts, nil)
52+
}

api/routers/workdays/workdays.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ func New(c api.ApiClient) (a) {
3838

3939
// Get Workdays by Company
4040
func (r a) GetByCompany(company string, fromDate string, tillDate string, params map[string]string) (*http.Response, []byte) {
41-
return r.client.Get("/team/v2/workdays/companies/" + company + "/" + fromDate + "," + tillDate, params)
41+
return r.client.Get("/team/v3/workdays/companies/" + company + "/" + fromDate + "," + tillDate, params)
4242
}
4343

4444
// Get Workdays by Contract
4545
func (r a) GetByContract(contract string, fromDate string, tillDate string, params map[string]string) (*http.Response, []byte) {
46-
return r.client.Get("/team/v2/workdays/contracts/" + contract + "/" + fromDate + "," + tillDate, params)
47-
}
46+
return r.client.Get("/team/v3/workdays/contracts/" + contract + "/" + fromDate + "," + tillDate, params)
47+
}

api/routers/workdiary/workdiary.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ func New(c api.ApiClient) (a) {
3737
}
3838

3939
// Get Workdiary
40-
func (r a) Get(company string, username string, date string, params map[string]string) (*http.Response, []byte) {
41-
return r.client.Get("/team/v1/workdiaries/" + company + "/" + username + "/" + date, params)
40+
func (r a) Get(company string, date string, params map[string]string) (*http.Response, []byte) {
41+
return r.client.Get("/team/v3/workdiaries/companies/" + company + "/" + date, params)
4242
}
4343

4444
// Get Workdiary by Contract
4545
func (r a) GetByContract(contract string, date string, params map[string]string) (*http.Response, []byte) {
46-
return r.client.Get("/team/v2/workdiaries/contracts/" + contract + "/" + date, params)
47-
}
46+
return r.client.Get("/team/v3/workdiaries/contracts/" + contract + "/" + date, params)
47+
}

0 commit comments

Comments
 (0)