// SPDX-License-Identifier: GPL-3.0-or-later

// This file is auto-generated by scripts/generate_nymea_api.py
// Any changes made here will be lost when the files are regenerated.
// Do not edit manually.

#include "jsonrpcversionresponse.h"

namespace nymea::api {

JSONRPCVersionResponse JSONRPCVersionResponse::fromJson(const QJsonObject &object) {
    JSONRPCVersionResponse value;
    if (object.contains(QStringLiteral("protocol version"))) {
        value.protocolVersion = (object.value(QStringLiteral("protocol version"))).toString();
    }
    if (object.contains(QStringLiteral("qtBuildVersion"))) {
        value.qtBuildVersion = (object.value(QStringLiteral("qtBuildVersion"))).toString();
    }
    if (object.contains(QStringLiteral("qtVersion"))) {
        value.qtVersion = (object.value(QStringLiteral("qtVersion"))).toString();
    }
    if (object.contains(QStringLiteral("version"))) {
        value.version = (object.value(QStringLiteral("version"))).toString();
    }
    return value;
}

QJsonObject JSONRPCVersionResponse::toJson() const {
    QJsonObject object;
    object.insert(QStringLiteral("protocol version"), QJsonValue(protocolVersion));
    object.insert(QStringLiteral("qtBuildVersion"), QJsonValue(qtBuildVersion));
    object.insert(QStringLiteral("qtVersion"), QJsonValue(qtVersion));
    object.insert(QStringLiteral("version"), QJsonValue(version));
    return object;
}

} // namespace nymea::api
