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

#include "push_ruleset.h"

using namespace QMatrixClient;

QJsonObject QMatrixClient::toJson(const PushRuleset& pod)
{
    QJsonObject _json;
    addToJson<IfNotEmpty>(_json, "content", pod.content);
    addToJson<IfNotEmpty>(_json, "override", pod.override);
    addToJson<IfNotEmpty>(_json, "room", pod.room);
    addToJson<IfNotEmpty>(_json, "sender", pod.sender);
    addToJson<IfNotEmpty>(_json, "underride", pod.underride);
    return _json;
}

PushRuleset FromJson<PushRuleset>::operator()(const QJsonValue& jv)
{
    const auto& _json = jv.toObject();
    PushRuleset result;
    result.content =
        fromJson<QVector<PushRule>>(_json.value("content"));
    result.override =
        fromJson<QVector<PushRule>>(_json.value("override"));
    result.room =
        fromJson<QVector<PushRule>>(_json.value("room"));
    result.sender =
        fromJson<QVector<PushRule>>(_json.value("sender"));
    result.underride =
        fromJson<QVector<PushRule>>(_json.value("underride"));
    
    return result;
}