diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-07-18 18:42:02 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-07-18 18:42:02 +0900 |
commit | f3a251404c00787b650e618fb5c257162507c18b (patch) | |
tree | a801eb5f444a8b2b3f8d93d2b64e22785bbf3f97 /lib/application-service/definitions/user.cpp | |
parent | 5e6b4bb975fa9697a6aca001629c65db506a437f (diff) | |
download | libquotient-f3a251404c00787b650e618fb5c257162507c18b.tar.gz libquotient-f3a251404c00787b650e618fb5c257162507c18b.zip |
csapi: third_party_lookup.* and its dependencies in application-service/
As per the latest API definitions.
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; +} + |