-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.power
More file actions
68 lines (63 loc) · 1.71 KB
/
code.power
File metadata and controls
68 lines (63 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
* Start stopwatch on an issue.
*
* @param string $owner The owner name.
* @param string $repo The repo name.
* @param int $index The issue index.
*
* @return string
* @since 3.2.0
**/
public function start(string $owner, string $repo, int $index): string
{
// Build the request path.
$path = "/repos/{$owner}/{$repo}/issues/{$index}/stopwatch/start";
// Send the post request.
return $this->response->get(
$this->http->post(
$this->uri->get($path), ''
), 201, 'success'
);
}
/**
* Stop an issue's existing stopwatch.
*
* @param string $owner The owner name.
* @param string $repo The repo name.
* @param int $index The issue index.
*
* @return string
* @since 3.2.0
**/
public function stop(string $owner, string $repo, int $index): string
{
// Build the request path.
$path = "/repos/{$owner}/{$repo}/issues/{$index}/stopwatch/stop";
// Send the post request.
return $this->response->get(
$this->http->post(
$this->uri->get($path), ''
), 201, 'success'
);
}
/**
* Delete an issue's existing stopwatch.
*
* @param string $owner The owner name.
* @param string $repo The repo name.
* @param int $index The issue index.
*
* @return string
* @since 3.2.0
**/
public function delete(string $owner, string $repo, int $index): string
{
// Build the request path.
$path = "/repos/{$owner}/{$repo}/issues/{$index}/stopwatch/delete";
// Send the delete request.
return $this->response->get(
$this->http->delete(
$this->uri->get($path)
), 204, 'success'
);
}