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

namespace nymea::api {

RulesRuleActiveChangedNotificationParams RulesRuleActiveChangedNotificationParams::fromJson(const QJsonObject &object) {
    RulesRuleActiveChangedNotificationParams value;
    if (object.contains(QStringLiteral("active"))) {
        value.active = (object.value(QStringLiteral("active"))).toBool();
    }
    if (object.contains(QStringLiteral("ruleId"))) {
        value.ruleId = QUuid((object.value(QStringLiteral("ruleId"))).toString());
    }
    return value;
}

QJsonObject RulesRuleActiveChangedNotificationParams::toJson() const {
    QJsonObject object;
    object.insert(QStringLiteral("active"), QJsonValue(active));
    object.insert(QStringLiteral("ruleId"), QJsonValue((ruleId).toString()));
    return object;
}

} // namespace nymea::api
