| @@ 204-218 (lines=15) @@ | ||
| 201 | * |
|
| 202 | * @return DeleteCredentialResponse|array|ResponseInterface |
|
| 203 | */ |
|
| 204 | public function deleteCredential($domain, $login) |
|
| 205 | { |
|
| 206 | Assert::stringNotEmpty($domain); |
|
| 207 | Assert::stringNotEmpty($login); |
|
| 208 | ||
| 209 | $response = $this->httpDelete( |
|
| 210 | sprintf( |
|
| 211 | '/v3/domains/%s/credentials/%s', |
|
| 212 | $domain, |
|
| 213 | $login |
|
| 214 | ) |
|
| 215 | ); |
|
| 216 | ||
| 217 | return $this->deserializer->deserialize($response, DeleteCredentialResponse::class); |
|
| 218 | } |
|
| 219 | ||
| 220 | /** |
|
| 221 | * Returns delivery connection settings for the specified domain. |
|
| @@ 29-36 (lines=8) @@ | ||
| 26 | * |
|
| 27 | * @return TotalResponse|array |
|
| 28 | */ |
|
| 29 | public function total($domain, array $params = []) |
|
| 30 | { |
|
| 31 | Assert::stringNotEmpty($domain); |
|
| 32 | ||
| 33 | $response = $this->httpGet(sprintf('/v3/%s/stats/total', rawurlencode($domain)), $params); |
|
| 34 | ||
| 35 | return $this->deserializer->deserialize($response, TotalResponse::class); |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * @param $domain |
|
| @@ 44-51 (lines=8) @@ | ||
| 41 | * |
|
| 42 | * @return AllResponse|array |
|
| 43 | */ |
|
| 44 | public function all($domain, array $params = []) |
|
| 45 | { |
|
| 46 | Assert::stringNotEmpty($domain); |
|
| 47 | ||
| 48 | $response = $this->httpGet(sprintf('/v3/%s/stats', rawurlencode($domain)), $params); |
|
| 49 | ||
| 50 | return $this->deserializer->deserialize($response, AllResponse::class); |
|
| 51 | } |
|
| 52 | } |
|
| 53 | ||
| @@ 36-43 (lines=8) @@ | ||
| 33 | * |
|
| 34 | * @return ShowResponse |
|
| 35 | */ |
|
| 36 | public function show($domain, $webhook) |
|
| 37 | { |
|
| 38 | Assert::notEmpty($domain); |
|
| 39 | Assert::notEmpty($webhook); |
|
| 40 | $response = $this->httpGet(sprintf('/v3/domains/%s/webhooks/%s', $domain, $webhook)); |
|
| 41 | ||
| 42 | return $this->deserializer->deserialize($response, ShowResponse::class); |
|
| 43 | } |
|
| 44 | ||
| 45 | /** |
|
| 46 | * @param string $domain |
|
| @@ 96-104 (lines=9) @@ | ||
| 93 | * |
|
| 94 | * @return DeleteResponse |
|
| 95 | */ |
|
| 96 | public function delete($domain, $id) |
|
| 97 | { |
|
| 98 | Assert::notEmpty($domain); |
|
| 99 | Assert::notEmpty($id); |
|
| 100 | ||
| 101 | $response = $this->httpDelete(sprintf('/v3/domains/%s/webhooks/%s', $domain, $id)); |
|
| 102 | ||
| 103 | return $this->deserializer->deserialize($response, DeleteResponse::class); |
|
| 104 | } |
|
| 105 | } |
|
| 106 | ||