5 #include <Quotient/converters.h>
19 QStringList algorithms;
24 QHash<QString, QString> keys;
31 QHash<UserId, QHash<QString, QString>> signatures;
35 struct JsonObjectConverter<DeviceKeys> {
36 static void dumpTo(QJsonObject& jo,
const DeviceKeys& pod)
38 addParam<>(jo,
"user_id"_L1, pod.userId);
39 addParam<>(jo,
"device_id"_L1, pod.deviceId);
40 addParam<>(jo,
"algorithms"_L1, pod.algorithms);
41 addParam<>(jo,
"keys"_L1, pod.keys);
42 addParam<>(jo,
"signatures"_L1, pod.signatures);
44 static void fillFrom(
const QJsonObject& jo, DeviceKeys& pod)
46 fillFromJson(jo.value(
"user_id"_L1), pod.userId);
47 fillFromJson(jo.value(
"device_id"_L1), pod.deviceId);
48 fillFromJson(jo.value(
"algorithms"_L1), pod.algorithms);
49 fillFromJson(jo.value(
"keys"_L1), pod.keys);
50 fillFromJson(jo.value(
"signatures"_L1), pod.signatures);