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

namespace nymea::api {

NetworkManagerGetNetworkStatusResponse NetworkManagerGetNetworkStatusResponse::fromJson(const QJsonObject &object) {
    NetworkManagerGetNetworkStatusResponse value;
    if (object.contains(QStringLiteral("networkManagerError"))) {
        value.networkManagerError = parseNetworkManagerError(object.value(QStringLiteral("networkManagerError")));
    }
    if (object.contains(QStringLiteral("status"))) {
        value.status = NetworkManagerGetNetworkStatusResponseStatus::fromJson((object.value(QStringLiteral("status"))).toObject());
    }
    return value;
}

QJsonObject NetworkManagerGetNetworkStatusResponse::toJson() const {
    QJsonObject object;
    object.insert(QStringLiteral("networkManagerError"), QJsonValue(toString(networkManagerError)));
    if (status.has_value()) {
        object.insert(QStringLiteral("status"), QJsonValue((*status).toJson()));
    }
    return object;
}

} // namespace nymea::api
