1 <?php
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
17
18 namespace OpenCloud\CloudMonitoring\Resource;
19
20 use OpenCloud\Common\Http\Message\Formatter;
21
22 23 24
25 class NotificationHistory extends ReadOnlyResource
26 {
27 private $id;
28 private $timestamp;
29 private $notification_plan_id;
30 private $transaction_id;
31 private $status;
32 private $state;
33 private $notification_results;
34 private $previous_state;
35
36 protected static $json_name = false;
37 protected static $json_collection_name = 'values';
38 protected static $url_resource = 'notification_history';
39
40 public function listChecks()
41 {
42 $response = $this->getClient()->get($this->url())->send();
43
44 return Formatter::decode($response);
45 }
46
47 public function listHistory($checkId)
48 {
49 return $this->getService()->collection(get_class(), $this->url($checkId));
50 }
51
52 public function getSingleHistoryItem($checkId, $historyId)
53 {
54 $url = $this->url($checkId . '/' . $historyId);
55 $response = $this->getClient()->get($url)->send();
56
57 if (null !== ($decoded = Formatter::decode($response))) {
58 $this->populate($decoded);
59 }
60
61 return false;
62 }
63 }
64