libQuotient
A Qt library for building matrix clients
Loading...
Searching...
No Matches
push_rule.h
Go to the documentation of this file.
1// THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
2
3#pragma once
4
5#include <Quotient/csapi/definitions/push_condition.h>
6
7#include <Quotient/converters.h>
8
9namespace Quotient {
10
12 //! The actions to perform when this rule is matched.
14
15 //! Whether this is a default rule, or has been set explicitly.
17
18 //! Whether the push rule is enabled or not.
19 bool enabled;
20
21 //! The ID of this rule.
23
24 //! The conditions that must hold true for an event in order for a rule to be
25 //! applied to an event. A rule with no conditions always matches. Only
26 //! applicable to `underride` and `override` rules.
28
29 //! The [glob-style pattern](/appendices#glob-style-matching) to match against.
30 //! Only applicable to `content` rules.
32};
33
34template <>
36 static void dumpTo(QJsonObject& jo, const PushRule& pod)
37 {
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);
44 }
45 static void fillFrom(const QJsonObject& jo, PushRule& pod)
46 {
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);
53 }
54};
55
56} // namespace Quotient
#define QUOTIENT_API