diff options
Diffstat (limited to 'lib/csapi/registration.cpp')
-rw-r--r-- | lib/csapi/registration.cpp | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/lib/csapi/registration.cpp b/lib/csapi/registration.cpp index c0a35917..bdfa4606 100644 --- a/lib/csapi/registration.cpp +++ b/lib/csapi/registration.cpp @@ -79,10 +79,10 @@ BaseJob::Status RegisterJob::parseJson(const QJsonDocument& data) return Success; } -static const auto RequestTokenToRegisterJobName = QStringLiteral("RequestTokenToRegisterJob"); +static const auto RequestTokenToRegisterEmailJobName = QStringLiteral("RequestTokenToRegisterEmailJob"); -RequestTokenToRegisterJob::RequestTokenToRegisterJob(const QString& clientSecret, const QString& email, int sendAttempt, const QString& idServer) - : BaseJob(HttpVerb::Post, RequestTokenToRegisterJobName, +RequestTokenToRegisterEmailJob::RequestTokenToRegisterEmailJob(const QString& clientSecret, const QString& email, int sendAttempt, const QString& idServer) + : BaseJob(HttpVerb::Post, RequestTokenToRegisterEmailJobName, basePath % "/register/email/requestToken", false) { QJsonObject _data; @@ -93,6 +93,21 @@ RequestTokenToRegisterJob::RequestTokenToRegisterJob(const QString& clientSecret setRequestData(_data); } +static const auto RequestTokenToRegisterMSISDNJobName = QStringLiteral("RequestTokenToRegisterMSISDNJob"); + +RequestTokenToRegisterMSISDNJob::RequestTokenToRegisterMSISDNJob(const QString& clientSecret, const QString& country, const QString& phoneNumber, double sendAttempt, const QString& idServer) + : BaseJob(HttpVerb::Post, RequestTokenToRegisterMSISDNJobName, + basePath % "/register/msisdn/requestToken", false) +{ + QJsonObject _data; + addParam<IfNotEmpty>(_data, QStringLiteral("id_server"), idServer); + addParam<>(_data, QStringLiteral("client_secret"), clientSecret); + addParam<>(_data, QStringLiteral("country"), country); + addParam<>(_data, QStringLiteral("phone_number"), phoneNumber); + addParam<>(_data, QStringLiteral("send_attempt"), sendAttempt); + setRequestData(_data); +} + static const auto ChangePasswordJobName = QStringLiteral("ChangePasswordJob"); ChangePasswordJob::ChangePasswordJob(const QString& newPassword, const Omittable<AuthenticationData>& auth) @@ -105,20 +120,34 @@ ChangePasswordJob::ChangePasswordJob(const QString& newPassword, const Omittable setRequestData(_data); } -QUrl RequestTokenToResetPasswordJob::makeRequestUrl(QUrl baseUrl) +QUrl RequestTokenToResetPasswordEmailJob::makeRequestUrl(QUrl baseUrl) { return BaseJob::makeRequestUrl(std::move(baseUrl), basePath % "/account/password/email/requestToken"); } -static const auto RequestTokenToResetPasswordJobName = QStringLiteral("RequestTokenToResetPasswordJob"); +static const auto RequestTokenToResetPasswordEmailJobName = QStringLiteral("RequestTokenToResetPasswordEmailJob"); -RequestTokenToResetPasswordJob::RequestTokenToResetPasswordJob() - : BaseJob(HttpVerb::Post, RequestTokenToResetPasswordJobName, +RequestTokenToResetPasswordEmailJob::RequestTokenToResetPasswordEmailJob() + : BaseJob(HttpVerb::Post, RequestTokenToResetPasswordEmailJobName, basePath % "/account/password/email/requestToken", false) { } +QUrl RequestTokenToResetPasswordMSISDNJob::makeRequestUrl(QUrl baseUrl) +{ + return BaseJob::makeRequestUrl(std::move(baseUrl), + basePath % "/account/password/msisdn/requestToken"); +} + +static const auto RequestTokenToResetPasswordMSISDNJobName = QStringLiteral("RequestTokenToResetPasswordMSISDNJob"); + +RequestTokenToResetPasswordMSISDNJob::RequestTokenToResetPasswordMSISDNJob() + : BaseJob(HttpVerb::Post, RequestTokenToResetPasswordMSISDNJobName, + basePath % "/account/password/msisdn/requestToken", false) +{ +} + static const auto DeactivateAccountJobName = QStringLiteral("DeactivateAccountJob"); DeactivateAccountJob::DeactivateAccountJob(const Omittable<AuthenticationData>& auth) |