diff options
Diffstat (limited to 'lib/application-service/definitions/user.cpp')
-rw-r--r-- | lib/application-service/definitions/user.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/application-service/definitions/user.cpp b/lib/application-service/definitions/user.cpp new file mode 100644 index 00000000..dfc12f29 --- /dev/null +++ b/lib/application-service/definitions/user.cpp @@ -0,0 +1,31 @@ +/****************************************************************************** + * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN + */ + +#include "user.h" + +using namespace QMatrixClient; + +QJsonObject QMatrixClient::toJson(const User& pod) +{ + QJsonObject _json; + addParam<IfNotEmpty>(_json, QStringLiteral("userid"), pod.userid); + addParam<IfNotEmpty>(_json, QStringLiteral("protocol"), pod.protocol); + addParam<IfNotEmpty>(_json, QStringLiteral("fields"), pod.fields); + return _json; +} + +User FromJson<User>::operator()(const QJsonValue& jv) +{ + const auto& _json = jv.toObject(); + User result; + result.userid = + fromJson<QString>(_json.value("userid"_ls)); + result.protocol = + fromJson<QString>(_json.value("protocol"_ls)); + result.fields = + fromJson<QJsonObject>(_json.value("fields"_ls)); + + return result; +} + |