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

#include "push_condition.h"

using namespace QMatrixClient;

QJsonObject QMatrixClient::toJson(const PushCondition& pod)
{
    QJsonObject _json;
    addToJson<>(_json, "kind", pod.kind);
    addToJson<IfNotEmpty>(_json, "key", pod.key);
    addToJson<IfNotEmpty>(_json, "pattern", pod.pattern);
    addToJson<IfNotEmpty>(_json, "is", pod.is);
    return _json;
}

PushCondition FromJson<PushCondition>::operator()(const QJsonValue& jv)
{
    const auto& _json = jv.toObject();
    PushCondition result;
    result.kind =
        fromJson<QString>(_json.value("kind"));
    result.key =
        fromJson<QString>(_json.value("key"));
    result.pattern =
        fromJson<QString>(_json.value("pattern"));
    result.is =
        fromJson<QString>(_json.value("is"));
    
    return result;
}