aboutsummaryrefslogtreecommitdiff
path: root/lib/application-service/definitions/location.cpp
blob: 958a55bf8468b0e6b69c0c11cbf16ae9169d504d (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
/******************************************************************************
 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
 */

#include "location.h"

using namespace QMatrixClient;

QJsonObject QMatrixClient::toJson(const ThirdPartyLocation& pod)
{
    QJsonObject jo;
    addParam<>(jo, QStringLiteral("alias"), pod.alias);
    addParam<>(jo, QStringLiteral("protocol"), pod.protocol);
    addParam<>(jo, QStringLiteral("fields"), pod.fields);
    return jo;
}

ThirdPartyLocation FromJsonObject<ThirdPartyLocation>::operator()(const QJsonObject& jo) const
{
    ThirdPartyLocation result;
    result.alias =
        fromJson<QString>(jo.value("alias"_ls));
    result.protocol =
        fromJson<QString>(jo.value("protocol"_ls));
    result.fields =
        fromJson<QJsonObject>(jo.value("fields"_ls));

    return result;
}