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

namespace nymea::api {

Script Script::fromJson(const QJsonObject &object) {
    Script value;
    if (object.contains(QStringLiteral("name"))) {
        value.name = (object.value(QStringLiteral("name"))).toString();
    }
    if (object.contains(QStringLiteral("id"))) {
        value.id = QUuid((object.value(QStringLiteral("id"))).toString());
    }
    return value;
}

QJsonObject Script::toJson() const {
    QJsonObject object;
    object.insert(QStringLiteral("name"), QJsonValue(name));
    object.insert(QStringLiteral("id"), QJsonValue((id).toString()));
    return object;
}

} // namespace nymea::api
