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

namespace nymea::api {

ConfigurationSetBackupConfigurationParams ConfigurationSetBackupConfigurationParams::fromJson(const QJsonObject &object) {
    ConfigurationSetBackupConfigurationParams value;
    if (object.contains(QStringLiteral("autoBackupEnabled"))) {
        value.autoBackupEnabled = (object.value(QStringLiteral("autoBackupEnabled"))).toBool();
    }
    if (object.contains(QStringLiteral("autoBackupInterval"))) {
        value.autoBackupInterval = jsonValueToInteger(object.value(QStringLiteral("autoBackupInterval")));
    }
    if (object.contains(QStringLiteral("destinationDirectory"))) {
        value.destinationDirectory = (object.value(QStringLiteral("destinationDirectory"))).toString();
    }
    if (object.contains(QStringLiteral("maxCount"))) {
        value.maxCount = jsonValueToUnsignedInteger(object.value(QStringLiteral("maxCount")));
    }
    return value;
}

QJsonObject ConfigurationSetBackupConfigurationParams::toJson() const {
    QJsonObject object;
    object.insert(QStringLiteral("autoBackupEnabled"), QJsonValue(autoBackupEnabled));
    object.insert(QStringLiteral("autoBackupInterval"), QJsonValue(static_cast<qint64>(autoBackupInterval)));
    object.insert(QStringLiteral("destinationDirectory"), QJsonValue(destinationDirectory));
    object.insert(QStringLiteral("maxCount"), QJsonValue(static_cast<qint64>(maxCount)));
    return object;
}

} // namespace nymea::api
