result = $data->Result ?? ResultType::FAIL; if (isset($data->Error)) { $errors = is_array($data->Error) ? $data->Error : [$data->Error]; foreach ($errors as $error) { $instance->error[] = Error::fromRaw($error); } } return $instance; } }