5 #include <Quotient/csapi/definitions/push_rule.h>
7 #include <Quotient/converters.h>
12 QVector<PushRule> content{};
14 QVector<PushRule> override{};
16 QVector<PushRule> room{};
18 QVector<PushRule> sender{};
20 QVector<PushRule> underride{};
24 struct JsonObjectConverter<PushRuleset> {
25 static void dumpTo(QJsonObject& jo,
const PushRuleset& pod)
27 addParam<IfNotEmpty>(jo,
"content"_L1, pod.content);
28 addParam<IfNotEmpty>(jo,
"override"_L1, pod.override);
29 addParam<IfNotEmpty>(jo,
"room"_L1, pod.room);
30 addParam<IfNotEmpty>(jo,
"sender"_L1, pod.sender);
31 addParam<IfNotEmpty>(jo,
"underride"_L1, pod.underride);
33 static void fillFrom(
const QJsonObject& jo, PushRuleset& pod)
35 fillFromJson(jo.value(
"content"_L1), pod.content);
36 fillFromJson(jo.value(
"override"_L1), pod.override);
37 fillFromJson(jo.value(
"room"_L1), pod.room);
38 fillFromJson(jo.value(
"sender"_L1), pod.sender);
39 fillFromJson(jo.value(
"underride"_L1), pod.underride);