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

namespace nymea::api {

IntegrationsConnectIOResponse IntegrationsConnectIOResponse::fromJson(const QJsonObject &object) {
    IntegrationsConnectIOResponse value;
    if (object.contains(QStringLiteral("ioConnectionId"))) {
        value.ioConnectionId = QUuid((object.value(QStringLiteral("ioConnectionId"))).toString());
    }
    if (object.contains(QStringLiteral("thingError"))) {
        value.thingError = parseThingError(object.value(QStringLiteral("thingError")));
    }
    return value;
}

QJsonObject IntegrationsConnectIOResponse::toJson() const {
    QJsonObject object;
    if (ioConnectionId.has_value()) {
        object.insert(QStringLiteral("ioConnectionId"), QJsonValue((*ioConnectionId).toString()));
    }
    object.insert(QStringLiteral("thingError"), QJsonValue(toString(thingError)));
    return object;
}

} // namespace nymea::api
