From 32729d9a7519cd2c4cddb0174b8329c6fd4a4a83 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 7 Jun 2020 19:46:40 +0200 Subject: Update generated files according to gtad/* changes --- lib/csapi/definitions/push_condition.h | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'lib/csapi/definitions/push_condition.h') diff --git a/lib/csapi/definitions/push_condition.h b/lib/csapi/definitions/push_condition.h index 189153b3..a6decf1b 100644 --- a/lib/csapi/definitions/push_condition.h +++ b/lib/csapi/definitions/push_condition.h @@ -8,13 +8,18 @@ namespace Quotient { -// Data structures - struct PushCondition { + /// The kind of condition to apply. See `conditions <#conditions>`_ for + /// more information on the allowed kinds and how they work. QString kind; /// Required for ``event_match`` conditions. The dot-separated field of the /// event to match. + /// + /// Required for ``sender_notification_permission`` conditions. The field in + /// the power level event the user needs a minimum power level for. Fields + /// must be specified under the ``notifications`` property in the power + /// level event's ``content``. QString key; /// Required for ``event_match`` conditions. The glob-style pattern to @@ -32,8 +37,20 @@ struct PushCondition { template <> struct JsonObjectConverter { - static void dumpTo(QJsonObject& jo, const PushCondition& pod); - static void fillFrom(const QJsonObject& jo, PushCondition& pod); + static void dumpTo(QJsonObject& jo, const PushCondition& pod) + { + addParam<>(jo, QStringLiteral("kind"), pod.kind); + addParam(jo, QStringLiteral("key"), pod.key); + addParam(jo, QStringLiteral("pattern"), pod.pattern); + addParam(jo, QStringLiteral("is"), pod.is); + } + static void fillFrom(const QJsonObject& jo, PushCondition& pod) + { + fromJson(jo.value("kind"_ls), pod.kind); + fromJson(jo.value("key"_ls), pod.key); + fromJson(jo.value("pattern"_ls), pod.pattern); + fromJson(jo.value("is"_ls), pod.is); + } }; } // namespace Quotient -- cgit v1.2.3