diff --git a/src/Api/Attachment.php b/src/Api/Attachment.php index 4de1d52..09bc10f 100644 --- a/src/Api/Attachment.php +++ b/src/Api/Attachment.php @@ -12,7 +12,6 @@ declare(strict_types=1); namespace Mailgun\Api; use Mailgun\Assert; -use Mailgun\Model\Attachment\Attachment as Model; use Psr\Http\Message\ResponseInterface; /** @@ -21,7 +20,7 @@ use Psr\Http\Message\ResponseInterface; class Attachment extends HttpApi { /** - * @return Model|ResponseInterface + * @return ResponseInterface */ public function show(string $url) { @@ -31,6 +30,10 @@ class Attachment extends HttpApi $response = $this->httpGet($url); - return $this->hydrateResponse($response, Model::class); + if (200 !== $response->getStatusCode()) { + $this->handleErrors($response); + } + + return $response; } } diff --git a/src/Model/Attachment/Attachment.php b/src/Model/Attachment/Attachment.php deleted file mode 100644 index d519215..0000000 --- a/src/Model/Attachment/Attachment.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ -final class Attachment implements ApiResponse -{ - private $data; - - private function __construct() - { - } - - public static function create(array $data): self - { - $new = new self(); - $new->data = $data; - - return $new; - } - - public function getData(): array - { - return $this->data; - } -}