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

namespace nymea::api {

IntegrationsSetEventLoggingParams IntegrationsSetEventLoggingParams::fromJson(const QJsonObject &object) {
    IntegrationsSetEventLoggingParams value;
    if (object.contains(QStringLiteral("enabled"))) {
        value.enabled = (object.value(QStringLiteral("enabled"))).toBool();
    }
    if (object.contains(QStringLiteral("eventTypeId"))) {
        value.eventTypeId = QUuid((object.value(QStringLiteral("eventTypeId"))).toString());
    }
    if (object.contains(QStringLiteral("thingId"))) {
        value.thingId = QUuid((object.value(QStringLiteral("thingId"))).toString());
    }
    return value;
}

QJsonObject IntegrationsSetEventLoggingParams::toJson() const {
    QJsonObject object;
    object.insert(QStringLiteral("enabled"), QJsonValue(enabled));
    object.insert(QStringLiteral("eventTypeId"), QJsonValue((eventTypeId).toString()));
    object.insert(QStringLiteral("thingId"), QJsonValue((thingId).toString()));
    return object;
}

} // namespace nymea::api
