1 | <?php |
||
10 | class Hooks |
||
11 | { |
||
12 | /** @var HttpClient HTTP Client */ |
||
13 | protected $http; |
||
14 | |||
15 | /** @var null|string Hooks API Key */ |
||
16 | protected $key = null; |
||
17 | |||
18 | /** |
||
19 | * @param null $key API Key |
||
20 | * @param HttpClient|null $httpClient |
||
21 | */ |
||
22 | public function __construct($key = null, HttpClient $httpClient = null) |
||
28 | |||
29 | /** |
||
30 | * Get HttpClient. |
||
31 | * |
||
32 | * @return HttpClient |
||
33 | */ |
||
34 | protected function httpClient() |
||
38 | |||
39 | /** |
||
40 | * Send Notification. |
||
41 | * |
||
42 | * @param array|\JsonSerializable $fields |
||
43 | * |
||
44 | * @var param $alertId |
||
45 | * @var param $message |
||
46 | * @var param $url |
||
47 | * |
||
48 | * @throws CouldNotSendNotification |
||
49 | * |
||
50 | * @return mixed |
||
51 | */ |
||
52 | public function send($fields) |
||
56 | |||
57 | /** |
||
58 | * Send an API request and return response. |
||
59 | * |
||
60 | * @param $fields |
||
61 | * |
||
62 | * @throws CouldNotSendNotification |
||
63 | * |
||
64 | * @return \Psr\Http\Message\ResponseInterface |
||
65 | */ |
||
66 | protected function api($fields) |
||
86 | } |
||
87 |