1/******************************************************************************
2 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
3 */
4
5#pragma once
6
7#include <Quotient/converters.h>
8#include <Quotient/identity/definitions/request_msisdn_validation.h>
9
10namespace Quotient {
11
12struct MsisdnValidationData : RequestMsisdnValidation {
13 /// The hostname of the identity server to communicate with. May optionally
14 /// include a port. This parameter is ignored when the homeserver handles
15 /// 3PID verification.
16 ///
17 /// This parameter is deprecated with a plan to be removed in a future
18 /// specification version for `/account/password` and `/register` requests.
19 QString idServer{};
20
21 /// An access token previously registered with the identity server. Servers
22 /// can treat this as optional to distinguish between r0.5-compatible
23 /// clients and this specification version.
24 ///
25 /// Required if an `id_server` is supplied.
26 QString idAccessToken{};
27};
28
29template <>
30struct JsonObjectConverter<MsisdnValidationData> {
31 static void dumpTo(QJsonObject& jo, const MsisdnValidationData& pod)
32 {
33 fillJson<RequestMsisdnValidation>(json&: jo, data: pod);
34 addParam<IfNotEmpty>(container&: jo, QStringLiteral("id_server"), value: pod.idServer);
35 addParam<IfNotEmpty>(container&: jo, QStringLiteral("id_access_token"),
36 value: pod.idAccessToken);
37 }
38 static void fillFrom(const QJsonObject& jo, MsisdnValidationData& pod)
39 {
40 fillFromJson<RequestMsisdnValidation>(jv: jo, pod);
41 fillFromJson(jv: jo.value(key: "id_server"_ls), pod&: pod.idServer);
42 fillFromJson(jv: jo.value(key: "id_access_token"_ls), pod&: pod.idAccessToken);
43 }
44};
45
46} // namespace Quotient
47