libQuotient
A Qt library for building matrix clients
location.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 ThirdPartyLocation {
10  //! An alias for a matrix room.
11  QString alias;
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<ThirdPartyLocation> {
22  static void dumpTo(QJsonObject& jo, const ThirdPartyLocation& pod)
23  {
24  addParam<>(jo, "alias"_L1, pod.alias);
25  addParam<>(jo, "protocol"_L1, pod.protocol);
26  addParam<>(jo, "fields"_L1, pod.fields);
27  }
28  static void fillFrom(const QJsonObject& jo, ThirdPartyLocation& pod)
29  {
30  fillFromJson(jo.value("alias"_L1), pod.alias);
31  fillFromJson(jo.value("protocol"_L1), pod.protocol);
32  fillFromJson(jo.value("fields"_L1), pod.fields);
33  }
34 };
35 
36 } // namespace Quotient