aboutsummaryrefslogtreecommitdiff
path: root/lib/identity/definitions/request_msisdn_validation.cpp
blob: 125baa9c05b1736b11c0546ff1296721611a421e (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 "request_msisdn_validation.h"

using namespace QMatrixClient;

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

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

    return result;
}