| @@ 16-51 (lines=36) @@ | ||
| 13 | ||
| 14 | use Mailgun\Model\ApiResponse; |
|
| 15 | ||
| 16 | final class Summary implements ApiResponse |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * @var SummaryResult |
|
| 20 | */ |
|
| 21 | private $result; |
|
| 22 | ||
| 23 | /** |
|
| 24 | * @var SummaryRisk |
|
| 25 | */ |
|
| 26 | private $risk; |
|
| 27 | ||
| 28 | public static function create(array $data): self |
|
| 29 | { |
|
| 30 | $model = new self(); |
|
| 31 | ||
| 32 | $model->result = SummaryResult::create($data['result']); |
|
| 33 | $model->risk = SummaryRisk::create($data['risk']); |
|
| 34 | ||
| 35 | return $model; |
|
| 36 | } |
|
| 37 | ||
| 38 | private function __construct() |
|
| 39 | { |
|
| 40 | } |
|
| 41 | ||
| 42 | public function getResult(): SummaryResult |
|
| 43 | { |
|
| 44 | return $this->result; |
|
| 45 | } |
|
| 46 | ||
| 47 | public function getRisk(): SummaryRisk |
|
| 48 | { |
|
| 49 | return $this->risk; |
|
| 50 | } |
|
| 51 | } |
|
| 52 | ||
| @@ 16-43 (lines=28) @@ | ||
| 13 | ||
| 14 | use Mailgun\Model\ApiResponse; |
|
| 15 | ||
| 16 | final class ValidationStatusSummary implements ApiResponse |
|
| 17 | { |
|
| 18 | private $result; |
|
| 19 | private $risk; |
|
| 20 | ||
| 21 | public static function create(array $data): self |
|
| 22 | { |
|
| 23 | $model = new self(); |
|
| 24 | $model->result = ValidationStatusSummaryResult::create($data['result'] ?? []); |
|
| 25 | $model->risk = ValidationStatusSummaryRisk::create($data['risk'] ?? []); |
|
| 26 | ||
| 27 | return $model; |
|
| 28 | } |
|
| 29 | ||
| 30 | private function __construct() |
|
| 31 | { |
|
| 32 | } |
|
| 33 | ||
| 34 | public function getResult(): ValidationStatusSummaryResult |
|
| 35 | { |
|
| 36 | return $this->result; |
|
| 37 | } |
|
| 38 | ||
| 39 | public function getRisk(): ValidationStatusSummaryRisk |
|
| 40 | { |
|
| 41 | return $this->risk; |
|
| 42 | } |
|
| 43 | } |
|
| 44 | ||