/****************************************************************************** * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN */ #include "public_rooms_response.h" using namespace QMatrixClient; QJsonObject QMatrixClient::toJson(const PublicRoomsChunk& pod) { QJsonObject _json; addParam(_json, QStringLiteral("aliases"), pod.aliases); addParam(_json, QStringLiteral("canonical_alias"), pod.canonicalAlias); addParam(_json, QStringLiteral("name"), pod.name); addParam<>(_json, QStringLiteral("num_joined_members"), pod.numJoinedMembers); addParam<>(_json, QStringLiteral("room_id"), pod.roomId); addParam(_json, QStringLiteral("topic"), pod.topic); addParam<>(_json, QStringLiteral("world_readable"), pod.worldReadable); addParam<>(_json, QStringLiteral("guest_can_join"), pod.guestCanJoin); addParam(_json, QStringLiteral("avatar_url"), pod.avatarUrl); return _json; } PublicRoomsChunk FromJson::operator()(const QJsonValue& jv) { const auto& _json = jv.toObject(); PublicRoomsChunk result; result.aliases = fromJson(_json.value("aliases"_ls)); result.canonicalAlias = fromJson(_json.value("canonical_alias"_ls)); result.name = fromJson(_json.value("name"_ls)); result.numJoinedMembers = fromJson(_json.value("num_joined_members"_ls)); result.roomId = fromJson(_json.value("room_id"_ls)); result.topic = fromJson(_json.value("topic"_ls)); result.worldReadable = fromJson(_json.value("world_readable"_ls)); result.guestCanJoin = fromJson(_json.value("guest_can_join"_ls)); result.avatarUrl = fromJson(_json.value("avatar_url"_ls)); return result; } QJsonObject QMatrixClient::toJson(const PublicRoomsResponse& pod) { QJsonObject _json; addParam<>(_json, QStringLiteral("chunk"), pod.chunk); addParam(_json, QStringLiteral("next_batch"), pod.nextBatch); addParam(_json, QStringLiteral("prev_batch"), pod.prevBatch); addParam(_json, QStringLiteral("total_room_count_estimate"), pod.totalRoomCountEstimate); return _json; } PublicRoomsResponse FromJson::operator()(const QJsonValue& jv) { const auto& _json = jv.toObject(); PublicRoomsResponse result; result.chunk = fromJson>(_json.value("chunk"_ls)); result.nextBatch = fromJson(_json.value("next_batch"_ls)); result.prevBatch = fromJson(_json.value("prev_batch"_ls)); result.totalRoomCountEstimate = fromJson(_json.value("total_room_count_estimate"_ls)); return result; }