mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2025-02-06 08:19:25 +03:00
Add ParsePesponse
This commit is contained in:
parent
0039e26be2
commit
e90f829eb4
69
src/Mailgun/Model/EmailValidation/Response/ParseResponse.php
Normal file
69
src/Mailgun/Model/EmailValidation/Response/ParseResponse.php
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2013 Mailgun
|
||||||
|
*
|
||||||
|
* This software may be modified and distributed under the terms
|
||||||
|
* of the MIT license. See the LICENSE file for details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Mailgun\Model\EmailValidation\Response;
|
||||||
|
|
||||||
|
use Mailgun\Model\ApiResponse;
|
||||||
|
use Mailgun\Model\EmailValidation\EmailValidation;
|
||||||
|
use Mailgun\Model\EmailValidation\Parse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author David Garcia <me@davidgarcia.cat>
|
||||||
|
*/
|
||||||
|
final class ParseResponse implements ApiResponse
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $message;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Parse
|
||||||
|
*/
|
||||||
|
private $parse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public static function create(array $data)
|
||||||
|
{
|
||||||
|
$message = isset($data['message']) ? $data['message'] : null;
|
||||||
|
$parse = Parse::create($data);
|
||||||
|
|
||||||
|
return new self($message, $parse);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ParseResponse Private Constructor.
|
||||||
|
*
|
||||||
|
* @param string|null $message
|
||||||
|
* @param Parse $parse
|
||||||
|
*/
|
||||||
|
private function __construct($message = null, Parse $parse = null)
|
||||||
|
{
|
||||||
|
$this->message = $message;
|
||||||
|
$this->parse = $parse;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getMessage()
|
||||||
|
{
|
||||||
|
return $this->message;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Parse
|
||||||
|
*/
|
||||||
|
public function getParse()
|
||||||
|
{
|
||||||
|
return $this->parse;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user