libQuotient
A Qt library for building matrix clients
user.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 ThirdPartyUser {
10  //! A Matrix User ID representing a third-party user.
11  QString userid;
12 
13  //! The protocol ID that the third-party location is a part of.
14  QString protocol;
15 
16  //! Information used to identify this third-party location.
17  QJsonObject fields;
18 };
19 
20 template <>
21 struct JsonObjectConverter<ThirdPartyUser> {
22  static void dumpTo(QJsonObject& jo, const ThirdPartyUser& pod)
23  {
24  addParam<>(jo, "userid"_L1, pod.userid);
25  addParam<>(jo, "protocol"_L1, pod.protocol);
26  addParam<>(jo, "fields"_L1, pod.fields);
27  }
28  static void fillFrom(const QJsonObject& jo, ThirdPartyUser& pod)
29  {
30  fillFromJson(jo.value("userid"_L1), pod.userid);
31  fillFromJson(jo.value("protocol"_L1), pod.protocol);
32  fillFromJson(jo.value("fields"_L1), pod.fields);
33  }
34 };
35 
36 } // namespace Quotient