libkazv
Loading...
Searching...
No Matches
third_party_signed.hpp
Go to the documentation of this file.
1/******************************************************************************
2 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
3 */
4
5#pragma once
6
7#include "types.hpp"
8
9
10namespace Kazv::Api {
14{
15
17 std::string sender;
18
20 std::string mxid;
21
23 std::string token;
24
26 immer::map<std::string, immer::map<std::string, std::string>> signatures;
27};
28
29}
30namespace nlohmann
31{
32using namespace Kazv;
33using namespace Kazv::Api;
34template<>
35struct adl_serializer<ThirdPartySigned> {
36 static void to_json(json& jo, const ThirdPartySigned &pod)
37 {
38 if (! jo.is_object()) { jo = json::object(); }
39
40
41 jo["sender"s] = pod.sender;
42
43 jo["mxid"s] = pod.mxid;
44
45 jo["token"s] = pod.token;
46
47 jo["signatures"s] = pod.signatures;
48
49 }
50 static void from_json(const json &jo, ThirdPartySigned& result)
51 {
52
53 if (jo.contains("sender"s)) {
54 result.sender = jo.at("sender"s);
55 }
56 if (jo.contains("mxid"s)) {
57 result.mxid = jo.at("mxid"s);
58 }
59 if (jo.contains("token"s)) {
60 result.token = jo.at("token"s);
61 }
62 if (jo.contains("signatures"s)) {
63 result.signatures = jo.at("signatures"s);
64 }
65
66 }
67};
68 }
69
70 namespace Kazv::Api
71 {
72} // namespace Kazv::Api
Definition location.hpp:10
Definition location.hpp:10
nlohmann::json json
Definition jsonwrap.hpp:20
Definition location.hpp:27
A signature of an m.third_party_invite token to prove that this user owns a third party identity whic...
Definition third_party_signed.hpp:14
immer::map< std::string, immer::map< std::string, std::string > > signatures
A signatures object containing a signature of the entire signed object.
Definition third_party_signed.hpp:26
std::string mxid
The Matrix ID of the invitee.
Definition third_party_signed.hpp:20
std::string sender
The Matrix ID of the user who issued the invite.
Definition third_party_signed.hpp:17
std::string token
The state key of the m.third_party_invite event.
Definition third_party_signed.hpp:23
static void from_json(const json &jo, ThirdPartySigned &result)
Definition third_party_signed.hpp:50
static void to_json(json &jo, const ThirdPartySigned &pod)
Definition third_party_signed.hpp:36