From 32729d9a7519cd2c4cddb0174b8329c6fd4a4a83 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 7 Jun 2020 19:46:40 +0200 Subject: Update generated files according to gtad/* changes --- lib/csapi/definitions/device_keys.h | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'lib/csapi/definitions/device_keys.h') diff --git a/lib/csapi/definitions/device_keys.h b/lib/csapi/definitions/device_keys.h index a067b4f3..3065f218 100644 --- a/lib/csapi/definitions/device_keys.h +++ b/lib/csapi/definitions/device_keys.h @@ -6,12 +6,7 @@ #include "converters.h" -#include - namespace Quotient { - -// Data structures - /// Device identity keys struct DeviceKeys { /// The ID of the user the device belongs to. Must match the user ID used @@ -40,8 +35,22 @@ struct DeviceKeys { template <> struct JsonObjectConverter { - static void dumpTo(QJsonObject& jo, const DeviceKeys& pod); - static void fillFrom(const QJsonObject& jo, DeviceKeys& pod); + static void dumpTo(QJsonObject& jo, const DeviceKeys& pod) + { + addParam<>(jo, QStringLiteral("user_id"), pod.userId); + addParam<>(jo, QStringLiteral("device_id"), pod.deviceId); + addParam<>(jo, QStringLiteral("algorithms"), pod.algorithms); + addParam<>(jo, QStringLiteral("keys"), pod.keys); + addParam<>(jo, QStringLiteral("signatures"), pod.signatures); + } + static void fillFrom(const QJsonObject& jo, DeviceKeys& pod) + { + fromJson(jo.value("user_id"_ls), pod.userId); + fromJson(jo.value("device_id"_ls), pod.deviceId); + fromJson(jo.value("algorithms"_ls), pod.algorithms); + fromJson(jo.value("keys"_ls), pod.keys); + fromJson(jo.value("signatures"_ls), pod.signatures); + } }; } // namespace Quotient -- cgit v1.2.3