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

namespace nymea::api {

TransfersDownloadAvailableNotificationParams TransfersDownloadAvailableNotificationParams::fromJson(const QJsonObject &object) {
    TransfersDownloadAvailableNotificationParams value;
    if (object.contains(QStringLiteral("downloadId"))) {
        value.downloadId = (object.value(QStringLiteral("downloadId"))).toString();
    }
    if (object.contains(QStringLiteral("fileName"))) {
        value.fileName = (object.value(QStringLiteral("fileName"))).toString();
    }
    if (object.contains(QStringLiteral("size"))) {
        value.size = jsonValueToInteger(object.value(QStringLiteral("size")));
    }
    return value;
}

QJsonObject TransfersDownloadAvailableNotificationParams::toJson() const {
    QJsonObject object;
    object.insert(QStringLiteral("downloadId"), QJsonValue(downloadId));
    object.insert(QStringLiteral("fileName"), QJsonValue(fileName));
    object.insert(QStringLiteral("size"), QJsonValue(static_cast<qint64>(size)));
    return object;
}

} // namespace nymea::api
