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

namespace nymea::api {

IntegrationsSetPluginConfigurationParams IntegrationsSetPluginConfigurationParams::fromJson(const QJsonObject &object) {
    IntegrationsSetPluginConfigurationParams value;
    if (object.contains(QStringLiteral("configuration"))) {
        value.configuration = ([&]() { QList<Param> list; for (const QJsonValue &item : (object.value(QStringLiteral("configuration"))).toArray()) { list.append(Param::fromJson((item).toObject())); } return list; }());
    }
    if (object.contains(QStringLiteral("pluginId"))) {
        value.pluginId = QUuid((object.value(QStringLiteral("pluginId"))).toString());
    }
    return value;
}

QJsonObject IntegrationsSetPluginConfigurationParams::toJson() const {
    QJsonObject object;
    object.insert(QStringLiteral("configuration"), ([&]() { QJsonArray array; for (const auto &item : configuration) { array.append(QJsonValue((item).toJson())); } return QJsonValue(array); }()));
    object.insert(QStringLiteral("pluginId"), QJsonValue((pluginId).toString()));
    return object;
}

} // namespace nymea::api
