diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-07-21 22:59:17 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-07-21 22:59:17 +0900 |
commit | 22b14860e6b2bda990a05167ae61d8d7f24a2427 (patch) | |
tree | 70e0b47a8460af0ee2b8ab9007977178ab196dd6 /lib/csapi/definitions/auth_data.cpp | |
parent | d3f1f39dafc87ce5b4654ac2a9b21df53dad1a4b (diff) | |
download | libquotient-22b14860e6b2bda990a05167ae61d8d7f24a2427.tar.gz libquotient-22b14860e6b2bda990a05167ae61d8d7f24a2427.zip |
csapi: add definitions/auth_data.* and optimise out trivial files with the latest GTAD
Diffstat (limited to 'lib/csapi/definitions/auth_data.cpp')
-rw-r--r-- | lib/csapi/definitions/auth_data.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/csapi/definitions/auth_data.cpp b/lib/csapi/definitions/auth_data.cpp new file mode 100644 index 00000000..94e3c05c --- /dev/null +++ b/lib/csapi/definitions/auth_data.cpp @@ -0,0 +1,29 @@ +/****************************************************************************** + * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN + */ + +#include "auth_data.h" + +using namespace QMatrixClient; + +QJsonObject QMatrixClient::toJson(const AuthenticationData& pod) +{ + QJsonObject _json = toJson(pod.authInfo); + addParam<>(_json, QStringLiteral("type"), pod.type); + addParam<IfNotEmpty>(_json, QStringLiteral("session"), pod.session); + return _json; +} + +AuthenticationData FromJson<AuthenticationData>::operator()(const QJsonValue& jv) +{ + auto _json = jv.toObject(); + AuthenticationData result; + result.type = + fromJson<QString>(_json.take("type"_ls)); + result.session = + fromJson<QString>(_json.take("session"_ls)); + + result.authInfo = fromJson<QHash<QString, QJsonObject>>(_json); + return result; +} + |