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