//SPDX-FileCopyrightText: 2023 Yury Gubich //SPDX-License-Identifier: GPL-3.0-or-later #include "test.h" const std::map Request::Test::structure({ {"type", QMetaType::QString}, {"version", QMetaType::QString}, }); Request::Test::Test (const QString& path): Request(path + "/test") {} void Request::Test::onSuccess (const QVariantMap& data) { if (!validateResponse(data, structure)) return onError("Malformed response", data); QString type = data.value("type").toString(); if (type != "pica") return onError("server of this type (" + type + ") is not supported", data); QString version = data.value("version").toString(); if (version != "0.0.1") return onError("server of this version (" + version + ") is not supported", data); Request::onSuccess(data); }