5 #include <Quotient/csapi/definitions/push_condition.h>
7 #include <Quotient/converters.h>
13 QVector<QVariant> actions;
27 QVector<PushCondition> conditions{};
35 struct JsonObjectConverter<PushRule> {
36 static void dumpTo(QJsonObject& jo,
const PushRule& pod)
38 addParam<>(jo,
"actions"_L1, pod.actions);
39 addParam<>(jo,
"default"_L1, pod.isDefault);
40 addParam<>(jo,
"enabled"_L1, pod.enabled);
41 addParam<>(jo,
"rule_id"_L1, pod.ruleId);
42 addParam<IfNotEmpty>(jo,
"conditions"_L1, pod.conditions);
43 addParam<IfNotEmpty>(jo,
"pattern"_L1, pod.pattern);
45 static void fillFrom(
const QJsonObject& jo, PushRule& pod)
47 fillFromJson(jo.value(
"actions"_L1), pod.actions);
48 fillFromJson(jo.value(
"default"_L1), pod.isDefault);
49 fillFromJson(jo.value(
"enabled"_L1), pod.enabled);
50 fillFromJson(jo.value(
"rule_id"_L1), pod.ruleId);
51 fillFromJson(jo.value(
"conditions"_L1), pod.conditions);
52 fillFromJson(jo.value(
"pattern"_L1), pod.pattern);