/****************************************************************************** * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN */ #pragma once #include "converters.h" #include "csapi/definitions/push_condition.h" namespace Quotient { struct PushRule { /// The actions to perform when this rule is matched. QVector actions; /// Whether this is a default rule, or has been set explicitly. bool isDefault; /// Whether the push rule is enabled or not. bool enabled; /// The ID of this rule. QString ruleId; /// The conditions that must hold true for an event in order for a rule to /// be applied to an event. A rule with no conditions always matches. Only /// applicable to `underride` and `override` rules. QVector conditions; /// The glob-style pattern to match against. Only applicable to `content` /// rules. QString pattern; }; template <> struct JsonObjectConverter { static void dumpTo(QJsonObject& jo, const PushRule& pod) { addParam<>(jo, QStringLiteral("actions"), pod.actions); addParam<>(jo, QStringLiteral("default"), pod.isDefault); addParam<>(jo, QStringLiteral("enabled"), pod.enabled); addParam<>(jo, QStringLiteral("rule_id"), pod.ruleId); addParam(jo, QStringLiteral("conditions"), pod.conditions); addParam(jo, QStringLiteral("pattern"), pod.pattern); } static void fillFrom(const QJsonObject& jo, PushRule& pod) { fromJson(jo.value("actions"_ls), pod.actions); fromJson(jo.value("default"_ls), pod.isDefault); fromJson(jo.value("enabled"_ls), pod.enabled); fromJson(jo.value("rule_id"_ls), pod.ruleId); fromJson(jo.value("conditions"_ls), pod.conditions); fromJson(jo.value("pattern"_ls), pod.pattern); } }; } // namespace Quotient eceiptevent.cpp'>
blob: b36ddb237672e8612d4d734384c7c74d034e20ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76