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

Commit 20f9056

Browse files
authored
Merge pull request #31 from phrase/reopen-jobs
Add reopen jobs endpoint
2 parents fb976bc + 246b499 commit 20f9056

File tree

1 file changed

+52
-2
lines changed

1 file changed

+52
-2
lines changed

phraseapp/lib.go

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515
)
1616

1717
const (
18-
RevisionDocs = ""
19-
RevisionGenerator = ""
18+
RevisionDocs = "af8c8e121b03fbb27f30326738fd1c3ac086b0a2"
19+
RevisionGenerator = "HEAD/2018-08-10T135953/soenke"
2020
)
2121

2222
type Account struct {
@@ -2998,6 +2998,31 @@ func (client *Client) JobKeysDelete(project_id, id string, params *JobKeysDelete
29982998
return err
29992999
}
30003000

3001+
// Mark a job as uncompleted.
3002+
func (client *Client) JobReopen(project_id, id string) (*JobDetails, error) {
3003+
retVal := new(JobDetails)
3004+
err := func() error {
3005+
url := fmt.Sprintf("/v2/projects/%s/jobs/%s/reopen", project_id, id)
3006+
3007+
rc, err := client.sendRequest("POST", url, "", nil, 200)
3008+
if err != nil {
3009+
return err
3010+
}
3011+
defer rc.Close()
3012+
3013+
var reader io.Reader
3014+
if client.debug {
3015+
reader = io.TeeReader(rc, os.Stderr)
3016+
} else {
3017+
reader = rc
3018+
}
3019+
3020+
return json.NewDecoder(reader).Decode(&retVal)
3021+
3022+
}()
3023+
return retVal, err
3024+
}
3025+
30013026
// Get details on a single job for a given project.
30023027
func (client *Client) JobShow(project_id, id string) (*JobDetails, error) {
30033028
retVal := new(JobDetails)
@@ -3164,6 +3189,31 @@ func (client *Client) JobLocaleDelete(project_id, job_id, id string) error {
31643189
return err
31653190
}
31663191

3192+
// Mark a job locale as uncompleted.
3193+
func (client *Client) JobLocaleReopen(project_id, job_id, id string) (*JobLocale, error) {
3194+
retVal := new(JobLocale)
3195+
err := func() error {
3196+
url := fmt.Sprintf("/v2/projects/%s/jobs/%s/locales/%s/reopen", project_id, job_id, id)
3197+
3198+
rc, err := client.sendRequest("POST", url, "", nil, 200)
3199+
if err != nil {
3200+
return err
3201+
}
3202+
defer rc.Close()
3203+
3204+
var reader io.Reader
3205+
if client.debug {
3206+
reader = io.TeeReader(rc, os.Stderr)
3207+
} else {
3208+
reader = rc
3209+
}
3210+
3211+
return json.NewDecoder(reader).Decode(&retVal)
3212+
3213+
}()
3214+
return retVal, err
3215+
}
3216+
31673217
// Get a single job locale for a given job.
31683218
func (client *Client) JobLocaleShow(project_id, job_id, id string) (*JobLocale, error) {
31693219
retVal := new(JobLocale)

0 commit comments

Comments
 (0)