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 --- .../definitions/request_email_validation.cpp | 25 ------------------- .../definitions/request_email_validation.h | 26 +++++++++++++------ .../definitions/request_msisdn_validation.cpp | 27 -------------------- .../definitions/request_msisdn_validation.h | 29 ++++++++++++++++------ lib/identity/definitions/sid.cpp | 17 ------------- lib/identity/definitions/sid.h | 27 -------------------- 6 files changed, 40 insertions(+), 111 deletions(-) delete mode 100644 lib/identity/definitions/request_email_validation.cpp delete mode 100644 lib/identity/definitions/request_msisdn_validation.cpp delete mode 100644 lib/identity/definitions/sid.cpp delete mode 100644 lib/identity/definitions/sid.h (limited to 'lib/identity/definitions') diff --git a/lib/identity/definitions/request_email_validation.cpp b/lib/identity/definitions/request_email_validation.cpp deleted file mode 100644 index 22cb0072..00000000 --- a/lib/identity/definitions/request_email_validation.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/****************************************************************************** - * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN - */ - -#include "request_email_validation.h" - -using namespace Quotient; - -void JsonObjectConverter::dumpTo( - QJsonObject& jo, const RequestEmailValidation& pod) -{ - addParam<>(jo, QStringLiteral("client_secret"), pod.clientSecret); - addParam<>(jo, QStringLiteral("email"), pod.email); - addParam<>(jo, QStringLiteral("send_attempt"), pod.sendAttempt); - addParam(jo, QStringLiteral("next_link"), pod.nextLink); -} - -void JsonObjectConverter::fillFrom( - const QJsonObject& jo, RequestEmailValidation& 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); -} diff --git a/lib/identity/definitions/request_email_validation.h b/lib/identity/definitions/request_email_validation.h index 32c6eaaf..079da953 100644 --- a/lib/identity/definitions/request_email_validation.h +++ b/lib/identity/definitions/request_email_validation.h @@ -8,8 +8,6 @@ namespace Quotient { -// Data structures - struct RequestEmailValidation { /// A unique string generated by the client, and used to identify the /// validation attempt. It must be a string consisting of the characters @@ -26,18 +24,32 @@ struct RequestEmailValidation { /// avoid repeatedly sending the same email in the case of request /// retries between the POSTing user and the identity server. /// The client should increment this value if they desire a new - /// email (e.g. a reminder) to be sent. + /// email (e.g. a reminder) to be sent. If they do not, the server + /// should respond with success but not resend the email. int sendAttempt; - /// Optional. When the validation is completed, the identity - /// server will redirect the user to this URL. + /// Optional. When the validation is completed, the identity server will + /// redirect the user to this URL. This option is ignored when submitting + /// 3PID validation information through a POST request. QString nextLink; }; template <> struct JsonObjectConverter { - static void dumpTo(QJsonObject& jo, const RequestEmailValidation& pod); - static void fillFrom(const QJsonObject& jo, RequestEmailValidation& pod); + static void dumpTo(QJsonObject& jo, const RequestEmailValidation& pod) + { + addParam<>(jo, QStringLiteral("client_secret"), pod.clientSecret); + addParam<>(jo, QStringLiteral("email"), pod.email); + addParam<>(jo, QStringLiteral("send_attempt"), pod.sendAttempt); + addParam(jo, QStringLiteral("next_link"), pod.nextLink); + } + static void fillFrom(const QJsonObject& jo, RequestEmailValidation& pod) + { + fromJson(jo.value("client_secret"_ls), pod.clientSecret); + fromJson(jo.value("email"_ls), pod.email); + fromJson(jo.value("send_attempt"_ls), pod.sendAttempt); + fromJson(jo.value("next_link"_ls), pod.nextLink); + } }; } // namespace Quotient diff --git a/lib/identity/definitions/request_msisdn_validation.cpp b/lib/identity/definitions/request_msisdn_validation.cpp deleted file mode 100644 index 6024bf61..00000000 --- a/lib/identity/definitions/request_msisdn_validation.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/****************************************************************************** - * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN - */ - -#include "request_msisdn_validation.h" - -using namespace Quotient; - -void JsonObjectConverter::dumpTo( - QJsonObject& jo, const RequestMsisdnValidation& pod) -{ - addParam<>(jo, QStringLiteral("client_secret"), pod.clientSecret); - addParam<>(jo, QStringLiteral("country"), pod.country); - addParam<>(jo, QStringLiteral("phone_number"), pod.phoneNumber); - addParam<>(jo, QStringLiteral("send_attempt"), pod.sendAttempt); - addParam(jo, QStringLiteral("next_link"), pod.nextLink); -} - -void JsonObjectConverter::fillFrom( - const QJsonObject& jo, RequestMsisdnValidation& result) -{ - fromJson(jo.value("client_secret"_ls), result.clientSecret); - fromJson(jo.value("country"_ls), result.country); - fromJson(jo.value("phone_number"_ls), result.phoneNumber); - fromJson(jo.value("send_attempt"_ls), result.sendAttempt); - fromJson(jo.value("next_link"_ls), result.nextLink); -} diff --git a/lib/identity/definitions/request_msisdn_validation.h b/lib/identity/definitions/request_msisdn_validation.h index 90aed7b8..a29fd0de 100644 --- a/lib/identity/definitions/request_msisdn_validation.h +++ b/lib/identity/definitions/request_msisdn_validation.h @@ -8,8 +8,6 @@ namespace Quotient { -// Data structures - struct RequestMsisdnValidation { /// A unique string generated by the client, and used to identify the /// validation attempt. It must be a string consisting of the characters @@ -17,8 +15,8 @@ struct RequestMsisdnValidation { /// must not be empty. QString clientSecret; - /// The two-letter uppercase ISO country code that the number in - /// ``phone_number`` should be parsed as if it were dialled from. + /// The two-letter uppercase ISO-3166-1 alpha-2 country code that the + /// number in ``phone_number`` should be parsed as if it were dialled from. QString country; /// The phone number to validate. @@ -33,15 +31,30 @@ struct RequestMsisdnValidation { /// they desire a new SMS (e.g. a reminder) to be sent. int sendAttempt; - /// Optional. When the validation is completed, the identity - /// server will redirect the user to this URL. + /// Optional. When the validation is completed, the identity server will + /// redirect the user to this URL. This option is ignored when submitting + /// 3PID validation information through a POST request. QString nextLink; }; template <> struct JsonObjectConverter { - static void dumpTo(QJsonObject& jo, const RequestMsisdnValidation& pod); - static void fillFrom(const QJsonObject& jo, RequestMsisdnValidation& pod); + static void dumpTo(QJsonObject& jo, const RequestMsisdnValidation& pod) + { + addParam<>(jo, QStringLiteral("client_secret"), pod.clientSecret); + addParam<>(jo, QStringLiteral("country"), pod.country); + addParam<>(jo, QStringLiteral("phone_number"), pod.phoneNumber); + addParam<>(jo, QStringLiteral("send_attempt"), pod.sendAttempt); + addParam(jo, QStringLiteral("next_link"), pod.nextLink); + } + static void fillFrom(const QJsonObject& jo, RequestMsisdnValidation& pod) + { + fromJson(jo.value("client_secret"_ls), pod.clientSecret); + fromJson(jo.value("country"_ls), pod.country); + fromJson(jo.value("phone_number"_ls), pod.phoneNumber); + fromJson(jo.value("send_attempt"_ls), pod.sendAttempt); + fromJson(jo.value("next_link"_ls), pod.nextLink); + } }; } // namespace Quotient diff --git a/lib/identity/definitions/sid.cpp b/lib/identity/definitions/sid.cpp deleted file mode 100644 index 99fe9b59..00000000 --- a/lib/identity/definitions/sid.cpp +++ /dev/null @@ -1,17 +0,0 @@ -/****************************************************************************** - * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN - */ - -#include "sid.h" - -using namespace Quotient; - -void JsonObjectConverter::dumpTo(QJsonObject& jo, const Sid& pod) -{ - addParam<>(jo, QStringLiteral("sid"), pod.sid); -} - -void JsonObjectConverter::fillFrom(const QJsonObject& jo, Sid& result) -{ - fromJson(jo.value("sid"_ls), result.sid); -} diff --git a/lib/identity/definitions/sid.h b/lib/identity/definitions/sid.h deleted file mode 100644 index 981826f6..00000000 --- a/lib/identity/definitions/sid.h +++ /dev/null @@ -1,27 +0,0 @@ -/****************************************************************************** - * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN - */ - -#pragma once - -#include "converters.h" - -namespace Quotient { - -// Data structures - -struct Sid { - /// The session ID. Session IDs are opaque strings generated by the identity - /// server. They must consist entirely of the characters - /// ``[0-9a-zA-Z.=_-]``. Their length must not exceed 255 characters and - /// they must not be empty. - QString sid; -}; - -template <> -struct JsonObjectConverter { - static void dumpTo(QJsonObject& jo, const Sid& pod); - static void fillFrom(const QJsonObject& jo, Sid& pod); -}; - -} // namespace Quotient -- cgit v1.2.3