// 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 "cachehash.h"

namespace nymea::api {

CacheHash CacheHash::fromJson(const QJsonObject &object) {
    CacheHash value;
    if (object.contains(QStringLiteral("hash"))) {
        value.hash = (object.value(QStringLiteral("hash"))).toString();
    }
    if (object.contains(QStringLiteral("method"))) {
        value.method = (object.value(QStringLiteral("method"))).toString();
    }
    return value;
}

QJsonObject CacheHash::toJson() const {
    QJsonObject object;
    object.insert(QStringLiteral("hash"), QJsonValue(hash));
    object.insert(QStringLiteral("method"), QJsonValue(method));
    return object;
}

} // namespace nymea::api
