aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/definitions/wellknown/full.h
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2022-10-06 19:27:24 +0200
committern-peugnet <n.peugnet@free.fr>2022-10-06 19:27:24 +0200
commitd911b207f49e936b3e992200796110f0749ed150 (patch)
tree96d20ebb4d074a4c1755e21cb316a52d584daee3 /lib/csapi/definitions/wellknown/full.h
parent8ad8a74152c5701b6ca1f9a00487ba9257a439b4 (diff)
parent56c2f2e2b809b9077393eb617828f33d144f5634 (diff)
downloadlibquotient-d911b207f49e936b3e992200796110f0749ed150.tar.gz
libquotient-d911b207f49e936b3e992200796110f0749ed150.zip
New upstream version 0.7.0
Diffstat (limited to 'lib/csapi/definitions/wellknown/full.h')
-rw-r--r--lib/csapi/definitions/wellknown/full.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/csapi/definitions/wellknown/full.h b/lib/csapi/definitions/wellknown/full.h
new file mode 100644
index 00000000..a0ef2076
--- /dev/null
+++ b/lib/csapi/definitions/wellknown/full.h
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "converters.h"
+
+#include "csapi/definitions/wellknown/homeserver.h"
+#include "csapi/definitions/wellknown/identity_server.h"
+
+namespace Quotient {
+/// Used by clients to determine the homeserver, identity server, and other
+/// optional components they should be interacting with.
+struct DiscoveryInformation {
+ /// Used by clients to determine the homeserver, identity server, and other
+ /// optional components they should be interacting with.
+ HomeserverInformation homeserver;
+
+ /// Used by clients to determine the homeserver, identity server, and other
+ /// optional components they should be interacting with.
+ Omittable<IdentityServerInformation> identityServer;
+
+ /// Application-dependent keys using Java package naming convention.
+ QHash<QString, QJsonObject> additionalProperties;
+};
+
+template <>
+struct JsonObjectConverter<DiscoveryInformation> {
+ static void dumpTo(QJsonObject& jo, const DiscoveryInformation& pod)
+ {
+ fillJson(jo, pod.additionalProperties);
+ addParam<>(jo, QStringLiteral("m.homeserver"), pod.homeserver);
+ addParam<IfNotEmpty>(jo, QStringLiteral("m.identity_server"),
+ pod.identityServer);
+ }
+ static void fillFrom(QJsonObject jo, DiscoveryInformation& pod)
+ {
+ fromJson(jo.take("m.homeserver"_ls), pod.homeserver);
+ fromJson(jo.take("m.identity_server"_ls), pod.identityServer);
+ fromJson(jo, pod.additionalProperties);
+ }
+};
+
+} // namespace Quotient