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