blob: 833135ec9d489ad88813335c86f84ab2d6f877eb (
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
*/
#include "push_rule.h"
using namespace QMatrixClient;
QJsonObject QMatrixClient::toJson(const PushRule& pod)
{
QJsonObject _json;
addParam<>(_json, QStringLiteral("actions"), pod.actions);
addParam<>(_json, QStringLiteral("default"), pod.isDefault);
addParam<>(_json, QStringLiteral("enabled"), pod.enabled);
addParam<>(_json, QStringLiteral("rule_id"), pod.ruleId);
addParam<IfNotEmpty>(_json, QStringLiteral("conditions"), pod.conditions);
addParam<IfNotEmpty>(_json, QStringLiteral("pattern"), pod.pattern);
return _json;
}
PushRule FromJson<PushRule>::operator()(const QJsonValue& jv)
{
const auto& _json = jv.toObject();
PushRule result;
result.actions =
fromJson<QVector<QVariant>>(_json.value("actions"_ls));
result.isDefault =
fromJson<bool>(_json.value("default"_ls));
result.enabled =
fromJson<bool>(_json.value("enabled"_ls));
result.ruleId =
fromJson<QString>(_json.value("rule_id"_ls));
result.conditions =
fromJson<QVector<PushCondition>>(_json.value("conditions"_ls));
result.pattern =
fromJson<QString>(_json.value("pattern"_ls));
return result;
}
|