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

namespace nymea::api {

JSONRPCAuthenticateParams JSONRPCAuthenticateParams::fromJson(const QJsonObject &object) {
    JSONRPCAuthenticateParams value;
    if (object.contains(QStringLiteral("deviceName"))) {
        value.deviceName = (object.value(QStringLiteral("deviceName"))).toString();
    }
    if (object.contains(QStringLiteral("password"))) {
        value.password = (object.value(QStringLiteral("password"))).toString();
    }
    if (object.contains(QStringLiteral("username"))) {
        value.username = (object.value(QStringLiteral("username"))).toString();
    }
    return value;
}

QJsonObject JSONRPCAuthenticateParams::toJson() const {
    QJsonObject object;
    object.insert(QStringLiteral("deviceName"), QJsonValue(deviceName));
    object.insert(QStringLiteral("password"), QJsonValue(password));
    object.insert(QStringLiteral("username"), QJsonValue(username));
    return object;
}

} // namespace nymea::api
