aboutsummaryrefslogtreecommitdiff
path: root/lib/identity/definitions/request_email_validation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/identity/definitions/request_email_validation.cpp')
-rw-r--r--lib/identity/definitions/request_email_validation.cpp23
1 files changed, 8 insertions, 15 deletions
diff --git a/lib/identity/definitions/request_email_validation.cpp b/lib/identity/definitions/request_email_validation.cpp
index 95088bcb..47463a8b 100644
--- a/lib/identity/definitions/request_email_validation.cpp
+++ b/lib/identity/definitions/request_email_validation.cpp
@@ -6,28 +6,21 @@
using namespace QMatrixClient;
-QJsonObject QMatrixClient::toJson(const RequestEmailValidation& pod)
+void JsonObjectConverter<RequestEmailValidation>::dumpTo(
+ QJsonObject& jo, const RequestEmailValidation& pod)
{
- QJsonObject jo;
addParam<>(jo, QStringLiteral("client_secret"), pod.clientSecret);
addParam<>(jo, QStringLiteral("email"), pod.email);
addParam<>(jo, QStringLiteral("send_attempt"), pod.sendAttempt);
addParam<IfNotEmpty>(jo, QStringLiteral("next_link"), pod.nextLink);
- return jo;
}
-RequestEmailValidation FromJsonObject<RequestEmailValidation>::operator()(const QJsonObject& jo) const
+void JsonObjectConverter<RequestEmailValidation>::fillFrom(
+ const QJsonObject& jo, RequestEmailValidation& result)
{
- RequestEmailValidation result;
- result.clientSecret =
- fromJson<QString>(jo.value("client_secret"_ls));
- result.email =
- fromJson<QString>(jo.value("email"_ls));
- result.sendAttempt =
- fromJson<int>(jo.value("send_attempt"_ls));
- result.nextLink =
- fromJson<QString>(jo.value("next_link"_ls));
-
- return result;
+ fromJson(jo.value("client_secret"_ls), result.clientSecret);
+ fromJson(jo.value("email"_ls), result.email);
+ fromJson(jo.value("send_attempt"_ls), result.sendAttempt);
+ fromJson(jo.value("next_link"_ls), result.nextLink);
}