| 1 | #include <nlohmann/json.hpp> |
|---|---|
| 2 | #include <string> |
| 3 | |
| 4 | #include "mtx/events/pinned_events.hpp" |
| 5 | |
| 6 | using json = nlohmann::json; |
| 7 | |
| 8 | namespace mtx { |
| 9 | namespace events { |
| 10 | namespace state { |
| 11 | |
| 12 | void |
| 13 | from_json(const json &obj, PinnedEvents &event) |
| 14 | { |
| 15 | event.pinned = obj.value(key: "pinned", default_value: std::vector<std::string>{}); |
| 16 | } |
| 17 | |
| 18 | void |
| 19 | to_json(json &obj, const PinnedEvents &event) |
| 20 | { |
| 21 | obj["pinned"] = event.pinned; |
| 22 | } |
| 23 | |
| 24 | } // namespace state |
| 25 | } // namespace events |
| 26 | } // namespace mtx |
| 27 |