| 1 | /****************************************************************************** |
| 2 | * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN |
| 3 | */ |
| 4 | |
| 5 | #pragma once |
| 6 | |
| 7 | #include <Quotient/converters.h> |
| 8 | |
| 9 | namespace Quotient { |
| 10 | |
| 11 | struct RequestTokenResponse { |
| 12 | /// The session ID. Session IDs are opaque strings that must consist |
| 13 | /// entirely of the characters `[0-9a-zA-Z.=_-]`. Their length must not |
| 14 | /// exceed 255 characters and they must not be empty. |
| 15 | QString sid; |
| 16 | |
| 17 | /// An optional field containing a URL where the client must submit the |
| 18 | /// validation token to, with identical parameters to the Identity Service |
| 19 | /// API's `POST /validate/email/submitToken` endpoint (without the |
| 20 | /// requirement for an access token). The homeserver must send this token to |
| 21 | /// the user (if applicable), who should then be prompted to provide it to |
| 22 | /// the client. |
| 23 | /// |
| 24 | /// If this field is not present, the client can assume that verification |
| 25 | /// will happen without the client's involvement provided the homeserver |
| 26 | /// advertises this specification version in the `/versions` response |
| 27 | /// (ie: r0.5.0). |
| 28 | QUrl submitUrl{}; |
| 29 | }; |
| 30 | |
| 31 | template <> |
| 32 | struct JsonObjectConverter<RequestTokenResponse> { |
| 33 | static void dumpTo(QJsonObject& jo, const RequestTokenResponse& pod) |
| 34 | { |
| 35 | addParam<>(container&: jo, QStringLiteral("sid" ), value: pod.sid); |
| 36 | addParam<IfNotEmpty>(container&: jo, QStringLiteral("submit_url" ), value: pod.submitUrl); |
| 37 | } |
| 38 | static void fillFrom(const QJsonObject& jo, RequestTokenResponse& pod) |
| 39 | { |
| 40 | fillFromJson(jv: jo.value(key: "sid"_ls ), pod&: pod.sid); |
| 41 | fillFromJson(jv: jo.value(key: "submit_url"_ls ), pod&: pod.submitUrl); |
| 42 | } |
| 43 | }; |
| 44 | |
| 45 | } // namespace Quotient |
| 46 | |