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