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