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
<?php
namespace OpenCloud\CloudMonitoring\Resource;
use OpenCloud\Common\Http\Message\Formatter;
class NotificationHistory extends ReadOnlyResource
{
private $id;
private $timestamp;
private $notification_plan_id;
private $transaction_id;
private $status;
private $state;
private $notification_results;
private $previous_state;
protected static $json_name = false;
protected static $json_collection_name = 'values';
protected static $url_resource = 'notification_history';
public function listChecks()
{
$response = $this->getClient()->get($this->url())->send();
return Formatter::decode($response);
}
public function listHistory($checkId)
{
return $this->getService()->collection(get_class(), $this->url($checkId));
}
public function getSingleHistoryItem($checkId, $historyId)
{
$url = $this->url($checkId . '/' . $historyId);
$response = $this->getClient()->get($url)->send();
if (null !== ($decoded = Formatter::decode($response))) {
$this->populate($decoded);
}
return false;
}
}