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

namespace nymea::api {

LoggingCategory LoggingCategory::fromJson(const QJsonObject &object) {
    LoggingCategory value;
    if (object.contains(QStringLiteral("level"))) {
        value.level = parseLoggingLevel(object.value(QStringLiteral("level")));
    }
    if (object.contains(QStringLiteral("name"))) {
        value.name = (object.value(QStringLiteral("name"))).toString();
    }
    if (object.contains(QStringLiteral("type"))) {
        value.type = parseLoggingCategoryType(object.value(QStringLiteral("type")));
    }
    return value;
}

QJsonObject LoggingCategory::toJson() const {
    QJsonObject object;
    object.insert(QStringLiteral("level"), QJsonValue(toString(level)));
    object.insert(QStringLiteral("name"), QJsonValue(name));
    object.insert(QStringLiteral("type"), QJsonValue(toString(type)));
    return object;
}

} // namespace nymea::api
