| @@ 87-101 (lines=15) @@ | ||
| 84 | /** |
|
| 85 | * @return CreateResponse|ResponseInterface |
|
| 86 | */ |
|
| 87 | public function create(string $domain, string $id, string $url) |
|
| 88 | { |
|
| 89 | Assert::notEmpty($domain); |
|
| 90 | Assert::notEmpty($id); |
|
| 91 | Assert::notEmpty($url); |
|
| 92 | ||
| 93 | $params = [ |
|
| 94 | 'id' => $id, |
|
| 95 | 'url' => $url, |
|
| 96 | ]; |
|
| 97 | ||
| 98 | $response = $this->httpPost(sprintf('/v3/domains/%s/webhooks', $domain), $params); |
|
| 99 | ||
| 100 | return $this->hydrateResponse($response, CreateResponse::class); |
|
| 101 | } |
|
| 102 | ||
| 103 | /** |
|
| 104 | * @return UpdateResponse|ResponseInterface |
|
| @@ 106-119 (lines=14) @@ | ||
| 103 | /** |
|
| 104 | * @return UpdateResponse|ResponseInterface |
|
| 105 | */ |
|
| 106 | public function update(string $domain, string $id, string $url) |
|
| 107 | { |
|
| 108 | Assert::notEmpty($domain); |
|
| 109 | Assert::notEmpty($id); |
|
| 110 | Assert::notEmpty($url); |
|
| 111 | ||
| 112 | $params = [ |
|
| 113 | 'url' => $url, |
|
| 114 | ]; |
|
| 115 | ||
| 116 | $response = $this->httpPut(sprintf('/v3/domains/%s/webhooks/%s', $domain, $id), $params); |
|
| 117 | ||
| 118 | return $this->hydrateResponse($response, UpdateResponse::class); |
|
| 119 | } |
|
| 120 | ||
| 121 | /** |
|
| 122 | * @return DeleteResponse|ResponseInterface |
|