aboutsummaryrefslogtreecommitdiff
path: root/lib/identity/definitions/request_email_validation.cpp
blob: 95088bcb65c3f9d7e8564f59520cee7a06854b63 (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
/******************************************************************************
 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
 */

#include "request_email_validation.h"

using namespace QMatrixClient;

QJsonObject QMatrixClient::toJson(const RequestEmailValidation& pod)
{
    QJsonObject jo;
    addParam<>(jo, QStringLiteral("client_secret"), pod.clientSecret);
    addParam<>(jo, QStringLiteral("email"), pod.email);
    addParam<>(jo, QStringLiteral("send_attempt"), pod.sendAttempt);
    addParam<IfNotEmpty>(jo, QStringLiteral("next_link"), pod.nextLink);
    return jo;
}

RequestEmailValidation FromJsonObject<RequestEmailValidation>::operator()(const QJsonObject& jo) const
{
    RequestEmailValidation result;
    result.clientSecret =
        fromJson<QString>(jo.value("client_secret"_ls));
    result.email =
        fromJson<QString>(jo.value("email"_ls));
    result.sendAttempt =
        fromJson<int>(jo.value("send_attempt"_ls));
    result.nextLink =
        fromJson<QString>(jo.value("next_link"_ls));

    return result;
}