5 #include <Quotient/converters.h>
15 QString displayName{};
24 std::optional<qint64> lastSeenTs{};
28 struct JsonObjectConverter<Device> {
29 static void dumpTo(QJsonObject& jo,
const Device& pod)
31 addParam<>(jo,
"device_id"_L1, pod.deviceId);
32 addParam<IfNotEmpty>(jo,
"display_name"_L1, pod.displayName);
33 addParam<IfNotEmpty>(jo,
"last_seen_ip"_L1, pod.lastSeenIp);
34 addParam<IfNotEmpty>(jo,
"last_seen_ts"_L1, pod.lastSeenTs);
36 static void fillFrom(
const QJsonObject& jo, Device& pod)
38 fillFromJson(jo.value(
"device_id"_L1), pod.deviceId);
39 fillFromJson(jo.value(
"display_name"_L1), pod.displayName);
40 fillFromJson(jo.value(
"last_seen_ip"_L1), pod.lastSeenIp);
41 fillFromJson(jo.value(
"last_seen_ts"_L1), pod.lastSeenTs);