34 if (! jo.is_object()) { jo = json::object(); }
37 jo[
"alias"s] = pod.
alias;
41 jo[
"fields"s] = pod.
fields;
47 if (jo.contains(
"alias"s)) {
48 result.
alias = jo.at(
"alias"s);
50 if (jo.contains(
"protocol"s)) {
51 result.
protocol = jo.at(
"protocol"s);
53 if (jo.contains(
"fields"s)) {
54 result.
fields = jo.at(
"fields"s);
Definition: jsonwrap.hpp:23
Definition: location.hpp:10
Definition: location.hpp:10
nlohmann::json json
Definition: jsonwrap.hpp:20
Definition: location.hpp:27
Definition: location.hpp:13
std::string protocol
The protocol ID that the third party location is a part of.
Definition: location.hpp:19
JsonWrap fields
Information used to identify this third party location.
Definition: location.hpp:22
std::string alias
An alias for a matrix room.
Definition: location.hpp:16
static void to_json(json &jo, const ThirdPartyLocation &pod)
Definition: location.hpp:32
static void from_json(const json &jo, ThirdPartyLocation &result)
Definition: location.hpp:44