diff --git a/src/Mailgun/Model/EmailValidation/Response/ValidateResponse.php b/src/Mailgun/Model/EmailValidation/Response/ValidateResponse.php new file mode 100644 index 0000000..d4dedce --- /dev/null +++ b/src/Mailgun/Model/EmailValidation/Response/ValidateResponse.php @@ -0,0 +1,68 @@ + + */ +final class ValidateResponse implements ApiResponse +{ + /** + * @var string + */ + private $message; + + /** + * @var EmailValidation + */ + private $emailValidation; + + /** + * {@inheritdoc} + */ + public static function create(array $data) + { + $message = isset($data['message']) ? $data['message'] : null; + $route = isset($data['route']) ? EmailValidation::create($data['emailValidation']) : null; + + return new self($message, $route); + } + + /** + * CreateResponse Private Constructor. + * + * @param string|null $message + * @param EmailValidation|null $emailValidation + */ + private function __construct($message = null, EmailValidation $emailValidation = null) + { + $this->message = $message; + $this->emailValidation = $emailValidation; + } + + /** + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * @return EmailValidation + */ + public function getEmailValidation() + { + return $this->emailValidation; + } +}