1 | <?php |
||
2 | |||
3 | namespace OhDear\PhpSdk\Actions; |
||
4 | |||
5 | use OhDear\PhpSdk\Resources\Check; |
||
6 | |||
7 | trait ManagesChecks |
||
8 | { |
||
9 | public function enableCheck(int $checkId): Check |
||
10 | { |
||
11 | $checkAttributes = $this->post("checks/{$checkId}/enable"); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
12 | |||
13 | return new Check($checkAttributes, $this); |
||
14 | } |
||
15 | |||
16 | public function disableCheck(int $checkId): Check |
||
17 | { |
||
18 | $checkAttributes = $this->post("checks/{$checkId}/disable"); |
||
19 | |||
20 | return new Check($checkAttributes, $this); |
||
21 | } |
||
22 | |||
23 | public function requestRun(int $checkId): Check |
||
24 | { |
||
25 | $checkAttributes = $this->post("checks/{$checkId}/request-run"); |
||
26 | |||
27 | return new Check($checkAttributes, $this); |
||
28 | } |
||
29 | |||
30 | public function snooze(int $checkId, int $minutes) |
||
31 | { |
||
32 | $checkAttributes = $this->post("checks/{$checkId}/snooze", [ |
||
33 | 'minutes' => $minutes, |
||
34 | ]); |
||
35 | |||
36 | return new Check($checkAttributes, $this); |
||
37 | } |
||
38 | |||
39 | public function unsnooze(int $checkId): Check |
||
40 | { |
||
41 | $checkAttributes = $this->post("checks/{$checkId}/unsnooze"); |
||
42 | |||
43 | return new Check($checkAttributes, $this); |
||
44 | } |
||
45 | } |
||
46 |