| 1 | <?php |
||
| 16 | class WebHook extends AbstractResource |
||
| 17 | { |
||
| 18 | const HOOK_LEVEL_INFO = 'info'; |
||
| 19 | const HOOK_LEVEL_ERROR = 'error'; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | private $hookId; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | private $level = self::HOOK_LEVEL_INFO; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var string |
||
| 33 | */ |
||
| 34 | private $icon = null; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * WebHook constructor. |
||
| 38 | * @param Client $client |
||
| 39 | * @param string $hookId |
||
| 40 | */ |
||
| 41 | public function __construct(Client $client, string $hookId) |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @return $this|WebHook |
||
| 50 | */ |
||
| 51 | public function error(): WebHook |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @return $this|WebHook |
||
| 60 | */ |
||
| 61 | public function info(): WebHook |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @param string $type |
||
| 70 | * @return $this|WebHook |
||
| 71 | */ |
||
| 72 | public function icon(string $type): WebHook |
||
| 78 | |||
| 79 | /** |
||
| 80 | * @param string $message |
||
| 81 | * @return mixed |
||
| 82 | */ |
||
| 83 | public function send(string $message) |
||
| 87 | |||
| 88 | /** |
||
| 89 | * @param string $message |
||
| 90 | * @return Route |
||
| 91 | */ |
||
| 92 | private function buildRoute(string $message): Route |
||
| 107 | } |