libQuotient
A Qt library for building matrix clients
user_identifier.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 //! Identification information for a user
9 struct QUOTIENT_API UserIdentifier {
10  //! The type of identification. See [Identifier types](/client-server-api/#identifier-types)
11  //! for supported values and additional property descriptions.
12  QString type;
13 
14  //! Keys dependent on the identification type.
15  QVariantHash additionalProperties{};
16 };
17 
18 template <>
19 struct JsonObjectConverter<UserIdentifier> {
20  static void dumpTo(QJsonObject& jo, const UserIdentifier& pod)
21  {
22  fillJson(jo, pod.additionalProperties);
23  addParam<>(jo, "type"_L1, pod.type);
24  }
25  static void fillFrom(QJsonObject jo, UserIdentifier& pod)
26  {
27  fillFromJson(jo.take("type"_L1), pod.type);
28  fromJson(jo, pod.additionalProperties);
29  }
30 };
31 
32 } // namespace Quotient