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

namespace nymea::api {

Repository Repository::fromJson(const QJsonObject &object) {
    Repository value;
    if (object.contains(QStringLiteral("enabled"))) {
        value.enabled = (object.value(QStringLiteral("enabled"))).toBool();
    }
    if (object.contains(QStringLiteral("displayName"))) {
        value.displayName = (object.value(QStringLiteral("displayName"))).toString();
    }
    if (object.contains(QStringLiteral("id"))) {
        value.id = (object.value(QStringLiteral("id"))).toString();
    }
    return value;
}

QJsonObject Repository::toJson() const {
    QJsonObject object;
    object.insert(QStringLiteral("enabled"), QJsonValue(enabled));
    object.insert(QStringLiteral("displayName"), QJsonValue(displayName));
    object.insert(QStringLiteral("id"), QJsonValue(id));
    return object;
}

} // namespace nymea::api
