Completed
Push — master ( 00611e...d96c30 )
by
unknown
01:05
created

Check::unsnooze()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace OhDear\PhpSdk\Resources;
4
5
class Check extends ApiResource
6
{
7
    /**
8
     * The id of the site.
9
     *
10
     * @var int
11
     */
12
    public $id;
13
14
    /**
15
     * The type of the check.
16
     *
17
     * @var string
18
     */
19
    public $type;
20
21
    /**
22
     * The human readable version of type.
23
     *
24
     * @var string
25
     */
26
    public $label;
27
28
    /**
29
     * Is the check enabled?
30
     *
31
     * @var bool
32
     */
33
    public $enabled;
34
35
    /**
36
     * Enable the check.
37
     */
38
    public function enable()
39
    {
40
        $updatedCheck = $this->ohDear->enableCheck($this->id);
41
42
        $this->enabled = $updatedCheck->enabled;
43
    }
44
45
    /**
46
     * Disable the check.
47
     */
48
    public function disable()
49
    {
50
        $updatedCheck = $this->ohDear->disableCheck($this->id);
51
52
        $this->enabled = $updatedCheck->enabled;
53
    }
54
55
    /**
56
     * Request a new run.
57
     *
58
     * @return void
59
     */
60
    public function requestRun()
61
    {
62
        $this->ohDear->requestRun($this->id);
63
    }
64
65
    /**
66
     * Snooze this check.
67
     *
68
     * @return void
69
     */
70
    public function snooze(int $minutes)
71
    {
72
        $this->ohDear->snooze($this->id, $minutes);
73
    }
74
75
    /**
76
     * Unsnooze this check.
77
     *
78
     * @return void
79
     */
80
    public function unsnooze()
81
    {
82
        $this->ohDear->unsnooze($this->id);
83
    }
84
}
85