libQuotient
A Qt library for building matrix clients
full.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/csapi/definitions/wellknown/homeserver.h>
6 #include <Quotient/csapi/definitions/wellknown/identity_server.h>
7 
8 #include <Quotient/converters.h>
9 
10 namespace Quotient {
11 //! Used by clients to determine the homeserver, identity server, and other
12 //! optional components they should be interacting with.
13 struct QUOTIENT_API DiscoveryInformation {
14  HomeserverInformation homeserver;
15 
16  std::optional<IdentityServerInformation> identityServer{};
17 
18  //! Application-dependent keys using Java package naming convention.
19  QVariantHash additionalProperties{};
20 };
21 
22 template <>
23 struct JsonObjectConverter<DiscoveryInformation> {
24  static void dumpTo(QJsonObject& jo, const DiscoveryInformation& pod)
25  {
26  fillJson(jo, pod.additionalProperties);
27  addParam<>(jo, "m.homeserver"_L1, pod.homeserver);
28  addParam<IfNotEmpty>(jo, "m.identity_server"_L1, pod.identityServer);
29  }
30  static void fillFrom(QJsonObject jo, DiscoveryInformation& pod)
31  {
32  fillFromJson(jo.take("m.homeserver"_L1), pod.homeserver);
33  fillFromJson(jo.take("m.identity_server"_L1), pod.identityServer);
34  fromJson(jo, pod.additionalProperties);
35  }
36 };
37 
38 } // namespace Quotient