libQuotient
A Qt library for building matrix clients
auth_data.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 //! Used by clients to submit authentication information to the interactive-authentication API
9 struct QUOTIENT_API AuthenticationData {
10  //! The authentication type that the client is attempting to complete.
11  //! May be omitted if `session` is given, and the client is reissuing a
12  //! request which it believes has been completed out-of-band (for example,
13  //! via the [fallback mechanism](#fallback)).
14  QString type{};
15 
16  //! The value of the session key given by the homeserver.
17  QString session{};
18 
19  //! Keys dependent on the login type
20  QVariantHash authInfo{};
21 };
22 
23 template <>
24 struct JsonObjectConverter<AuthenticationData> {
25  static void dumpTo(QJsonObject& jo, const AuthenticationData& pod)
26  {
27  fillJson(jo, pod.authInfo);
28  addParam<IfNotEmpty>(jo, "type"_L1, pod.type);
29  addParam<IfNotEmpty>(jo, "session"_L1, pod.session);
30  }
31  static void fillFrom(QJsonObject jo, AuthenticationData& pod)
32  {
33  fillFromJson(jo.take("type"_L1), pod.type);
34  fillFromJson(jo.take("session"_L1), pod.session);
35  fromJson(jo, pod.authInfo);
36  }
37 };
38 
39 } // namespace Quotient