/****************************************************************************** * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN */ #include "protocol.h" using namespace QMatrixClient; QJsonObject QMatrixClient::toJson(const FieldType& pod) { QJsonObject jo; addParam(jo, QStringLiteral("regexp"), pod.regexp); addParam(jo, QStringLiteral("placeholder"), pod.placeholder); return jo; } FieldType FromJsonObject::operator()(const QJsonObject& jo) const { FieldType result; result.regexp = fromJson(jo.value("regexp"_ls)); result.placeholder = fromJson(jo.value("placeholder"_ls)); return result; } QJsonObject QMatrixClient::toJson(const FieldTypes& pod) { QJsonObject jo; addParam(jo, QStringLiteral("fieldname"), pod.fieldname); return jo; } FieldTypes FromJsonObject::operator()(const QJsonObject& jo) const { FieldTypes result; result.fieldname = fromJson(jo.value("fieldname"_ls)); return result; } QJsonObject QMatrixClient::toJson(const ThirdPartyProtocol& pod) { QJsonObject jo; addParam(jo, QStringLiteral("user_fields"), pod.userFields); addParam(jo, QStringLiteral("location_fields"), pod.locationFields); addParam(jo, QStringLiteral("icon"), pod.icon); addParam(jo, QStringLiteral("field_types"), pod.fieldTypes); addParam(jo, QStringLiteral("instances"), pod.instances); return jo; } ThirdPartyProtocol FromJsonObject::operator()(const QJsonObject& jo) const { ThirdPartyProtocol result; result.userFields = fromJson(jo.value("user_fields"_ls)); result.locationFields = fromJson(jo.value("location_fields"_ls)); result.icon = fromJson(jo.value("icon"_ls)); result.fieldTypes = fromJson(jo.value("field_types"_ls)); result.instances = fromJson>(jo.value("instances"_ls)); return result; }