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

namespace nymea::api {

AppDataLoadParams AppDataLoadParams::fromJson(const QJsonObject &object) {
    AppDataLoadParams value;
    if (object.contains(QStringLiteral("appId"))) {
        value.appId = (object.value(QStringLiteral("appId"))).toString();
    }
    if (object.contains(QStringLiteral("key"))) {
        value.key = (object.value(QStringLiteral("key"))).toString();
    }
    if (object.contains(QStringLiteral("group"))) {
        value.group = (object.value(QStringLiteral("group"))).toString();
    }
    return value;
}

QJsonObject AppDataLoadParams::toJson() const {
    QJsonObject object;
    object.insert(QStringLiteral("appId"), QJsonValue(appId));
    object.insert(QStringLiteral("key"), QJsonValue(key));
    if (group.has_value()) {
        object.insert(QStringLiteral("group"), QJsonValue(*group));
    }
    return object;
}

} // namespace nymea::api
