aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/definitions/push_ruleset.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csapi/definitions/push_ruleset.cpp')
-rw-r--r--lib/csapi/definitions/push_ruleset.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/csapi/definitions/push_ruleset.cpp b/lib/csapi/definitions/push_ruleset.cpp
new file mode 100644
index 00000000..98d79248
--- /dev/null
+++ b/lib/csapi/definitions/push_ruleset.cpp
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "push_ruleset.h"
+
+using namespace QMatrixClient;
+
+QJsonObject QMatrixClient::toJson(const PushRuleset& pod)
+{
+ QJsonObject _json;
+ addToJson<IfNotEmpty>(_json, "content", pod.content);
+ addToJson<IfNotEmpty>(_json, "override", pod.override);
+ addToJson<IfNotEmpty>(_json, "room", pod.room);
+ addToJson<IfNotEmpty>(_json, "sender", pod.sender);
+ addToJson<IfNotEmpty>(_json, "underride", pod.underride);
+ return _json;
+}
+
+PushRuleset FromJson<PushRuleset>::operator()(const QJsonValue& jv)
+{
+ const auto& _json = jv.toObject();
+ PushRuleset result;
+ result.content =
+ fromJson<QVector<PushRule>>(_json.value("content"));
+ result.override =
+ fromJson<QVector<PushRule>>(_json.value("override"));
+ result.room =
+ fromJson<QVector<PushRule>>(_json.value("room"));
+ result.sender =
+ fromJson<QVector<PushRule>>(_json.value("sender"));
+ result.underride =
+ fromJson<QVector<PushRule>>(_json.value("underride"));
+
+ return result;
+}
+