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

#include "push_ruleset.h"

using namespace QMatrixClient;

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

PushRuleset FromJsonObject<PushRuleset>::operator()(const QJsonObject& jo) const
{
    PushRuleset result;
    result.content =
        fromJson<QVector<PushRule>>(jo.value("content"_ls));
    result.override =
        fromJson<QVector<PushRule>>(jo.value("override"_ls));
    result.room =
        fromJson<QVector<PushRule>>(jo.value("room"_ls));
    result.sender =
        fromJson<QVector<PushRule>>(jo.value("sender"_ls));
    result.underride =
        fromJson<QVector<PushRule>>(jo.value("underride"_ls));

    return result;
}