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

#include "auth_data.h"

using namespace QMatrixClient;

QJsonObject QMatrixClient::toJson(const AuthenticationData& pod)
{
    QJsonObject _json = toJson(pod.authInfo);
    addParam<>(_json, QStringLiteral("type"), pod.type);
    addParam<IfNotEmpty>(_json, QStringLiteral("session"), pod.session);
    return _json;
}

AuthenticationData FromJson<AuthenticationData>::operator()(const QJsonValue& jv)
{
    auto _json = jv.toObject();
    AuthenticationData result;
    result.type =
        fromJson<QString>(_json.take("type"_ls));
    result.session =
        fromJson<QString>(_json.take("session"_ls));
    
    result.authInfo = fromJson<QHash<QString, QJsonObject>>(_json);
    return result;
}