Skip to content
This repository was archived by the owner on Jun 8, 2019. It is now read-only.

Commit 600c19a

Browse files
adelowolafriks
authored andcommitted
add SDK methods for starting/stopping a stopwatch (#142)
1 parent b9e7237 commit 600c19a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

gitea/issue.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,22 @@ func (c *Client) EditIssue(owner, repo string, index int64, opt EditIssueOption)
139139
jsonHeader, bytes.NewReader(body), issue)
140140
}
141141

142+
// StartIssueStopWatch starts a stopwatch for an existing issue for a given
143+
// repository
144+
func (c *Client) StartIssueStopWatch(owner, repo string, index int64) error {
145+
_, err := c.getResponse("POST", fmt.Sprintf("/repos/%s/%s/issues/%d/stopwatch/start", owner, repo, index),
146+
jsonHeader, nil)
147+
return err
148+
}
149+
150+
// StopIssueStopWatch stops an existing stopwatch for an issue in a given
151+
// repository
152+
func (c *Client) StopIssueStopWatch(owner, repo string, index int64) error {
153+
_, err := c.getResponse("POST", fmt.Sprintf("/repos/%s/%s/issues/%d/stopwatch/stop", owner, repo, index),
154+
jsonHeader, nil)
155+
return err
156+
}
157+
142158
// EditDeadlineOption options for creating a deadline
143159
type EditDeadlineOption struct {
144160
// required:true

0 commit comments

Comments
 (0)