candidates = $candidates; $this->messages = $messages; } public static function fromJson(object $json): self { return new self($json->candidates, $json->messages); } }