aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/registration_tokens.cpp
blob: 9c1f0587e7ebd01971ae51d75c03f3f5c4e21def (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/******************************************************************************
 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
 */

#include "registration_tokens.h"

using namespace Quotient;

auto queryToRegistrationTokenValidity(const QString& token)
{
    QUrlQuery _q;
    addParam<>(_q, QStringLiteral("token"), token);
    return _q;
}

QUrl RegistrationTokenValidityJob::makeRequestUrl(QUrl baseUrl,
                                                  const QString& token)
{
    return BaseJob::makeRequestUrl(
        std::move(baseUrl),
        makePath("/_matrix/client/v1",
                 "/register/m.login.registration_token/validity"),
        queryToRegistrationTokenValidity(token));
}

RegistrationTokenValidityJob::RegistrationTokenValidityJob(const QString& token)
    : BaseJob(HttpVerb::Get, QStringLiteral("RegistrationTokenValidityJob"),
              makePath("/_matrix/client/v1",
                       "/register/m.login.registration_token/validity"),
              queryToRegistrationTokenValidity(token), {}, false)
{
    addExpectedKey("valid");
}