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

namespace nymea::api {

UsersGetUsersResponse UsersGetUsersResponse::fromJson(const QJsonObject &object) {
    UsersGetUsersResponse value;
    if (object.contains(QStringLiteral("users"))) {
        value.users = ([&]() { QList<UserInfo> list; for (const QJsonValue &item : (object.value(QStringLiteral("users"))).toArray()) { list.append(UserInfo::fromJson((item).toObject())); } return list; }());
    }
    return value;
}

QJsonObject UsersGetUsersResponse::toJson() const {
    QJsonObject object;
    object.insert(QStringLiteral("users"), ([&]() { QJsonArray array; for (const auto &item : users) { array.append(QJsonValue((item).toJson())); } return QJsonValue(array); }()));
    return object;
}

} // namespace nymea::api
