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

namespace nymea::api {

SystemCapabilitiesChangedNotificationParams SystemCapabilitiesChangedNotificationParams::fromJson(const QJsonObject &object) {
    SystemCapabilitiesChangedNotificationParams value;
    if (object.contains(QStringLiteral("powerManagement"))) {
        value.powerManagement = (object.value(QStringLiteral("powerManagement"))).toBool();
    }
    if (object.contains(QStringLiteral("updateManagement"))) {
        value.updateManagement = (object.value(QStringLiteral("updateManagement"))).toBool();
    }
    if (object.contains(QStringLiteral("updateManagementType"))) {
        value.updateManagementType = parseUpdateType(object.value(QStringLiteral("updateManagementType")));
    }
    return value;
}

QJsonObject SystemCapabilitiesChangedNotificationParams::toJson() const {
    QJsonObject object;
    object.insert(QStringLiteral("powerManagement"), QJsonValue(powerManagement));
    object.insert(QStringLiteral("updateManagement"), QJsonValue(updateManagement));
    object.insert(QStringLiteral("updateManagementType"), QJsonValue(toString(updateManagementType)));
    return object;
}

} // namespace nymea::api
