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