1#include <nlohmann/json.hpp>
2#include <string>
3
4#include "mtx/events/redaction.hpp"
5
6using json = nlohmann::json;
7
8namespace mtx {
9namespace events {
10namespace msg {
11
12void
13from_json(const json &obj, Redaction &event)
14{
15 if (obj.count(key: "reason") != 0 && !obj.at(key: "reason").is_null())
16 event.reason = obj.at(key: "reason").get<std::string>();
17}
18
19void
20to_json(json &obj, const Redaction &event)
21{
22 obj["reason"] = event.reason;
23}
24
25} // namespace msg
26} // namespace events
27} // namespace mtx
28