-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.power
More file actions
69 lines (62 loc) · 1.61 KB
/
code.power
File metadata and controls
69 lines (62 loc) · 1.61 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
69
/**
* List the current user's tracked times.
*
* @param int $page Page number of results to return (1-based).
* @param int $limit Page size of results.
* @param string|null $since Optional. Only show times updated after the given time (RFC 3339 format).
* @param string|null $before Optional. Only show times updated before the given time (RFC 3339 format).
*
* @return array|null
* @since 3.2.0
**/
public function list(
int $page = 1,
int $limit = 10,
?string $since = null,
?string $before = null
): ?array
{
// Build the request path.
$path = '/user/times';
// Build the URL
$url = $this->uri->get($path);
$url->setVar('page', $page);
$url->setVar('limit', $limit);
if ($since !== null)
{
$url->setVar('since', $since);
}
if ($before !== null)
{
$url->setVar('before', $before);
}
// Send the get request.
return $this->response->get(
$this->http->get($url)
);
}
/**
* Get list of all existing stopwatches for the authenticated user.
*
* @param int $page Page number of results to return (1-based).
* @param int $limit Page size of results.
*
* @return array|null
* @since 3.2.0
**/
public function stopwatches(
int $page = 1,
int $limit = 10
): ?array
{
// Build the request path.
$path = '/user/stopwatches';
// Build the URL
$url = $this->uri->get($path);
$url->setVar('page', $page);
$url->setVar('limit', $limit);
// Send the get request.
return $this->response->get(
$this->http->get($url)
);
}