1/******************************************************************************
2 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
3 */
4
5#pragma once
6
7#include <Quotient/converters.h>
8
9namespace Quotient {
10/// A signature of an `m.third_party_invite` token to prove that this user
11/// owns a third-party identity which has been invited to the room.
12struct ThirdPartySigned {
13 /// The Matrix ID of the user who issued the invite.
14 QString sender;
15
16 /// The Matrix ID of the invitee.
17 QString mxid;
18
19 /// The state key of the m.third_party_invite event.
20 QString token;
21
22 /// A signatures object containing a signature of the entire signed object.
23 QHash<QString, QHash<QString, QString>> signatures;
24};
25
26template <>
27struct JsonObjectConverter<ThirdPartySigned> {
28 static void dumpTo(QJsonObject& jo, const ThirdPartySigned& pod)
29 {
30 addParam<>(container&: jo, QStringLiteral("sender"), value: pod.sender);
31 addParam<>(container&: jo, QStringLiteral("mxid"), value: pod.mxid);
32 addParam<>(container&: jo, QStringLiteral("token"), value: pod.token);
33 addParam<>(container&: jo, QStringLiteral("signatures"), value: pod.signatures);
34 }
35 static void fillFrom(const QJsonObject& jo, ThirdPartySigned& pod)
36 {
37 fillFromJson(jv: jo.value(key: "sender"_ls), pod&: pod.sender);
38 fillFromJson(jv: jo.value(key: "mxid"_ls), pod&: pod.mxid);
39 fillFromJson(jv: jo.value(key: "token"_ls), pod&: pod.token);
40 fillFromJson(jv: jo.value(key: "signatures"_ls), pod&: pod.signatures);
41 }
42};
43
44} // namespace Quotient
45