aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/definitions/push_rule.h
blob: d8d2cc0fa75c1d6879c3e1985627ee295dbb91d3 (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
/******************************************************************************
 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
 */

#pragma once

#include "converters.h"

#include "converters.h"
#include "csapi/definitions/push_condition.h"
#include <QtCore/QJsonObject>
#include <QtCore/QVariant>
#include <QtCore/QVector>

namespace QMatrixClient {
    // Data structures

    struct PushRule {
        /// The actions to perform when this rule is matched.
        QVector<QVariant> 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<PushCondition> conditions;
        /// The glob-style pattern to match against.  Only applicable to
        /// ``content`` rules.
        QString pattern;
    };
    template <> struct JsonObjectConverter<PushRule> {
        static void dumpTo(QJsonObject& jo, const PushRule& pod);
        static void fillFrom(const QJsonObject& jo, PushRule& pod);
    };

} // namespace QMatrixClient