aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/definitions/auth_data.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csapi/definitions/auth_data.cpp')
-rw-r--r--lib/csapi/definitions/auth_data.cpp29
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;
+}
+