/****************************************************************************** * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN */ #include "keys.h" #include using namespace Quotient; UploadKeysJob::UploadKeysJob(const Omittable& deviceKeys, const QHash& oneTimeKeys) : BaseJob(HttpVerb::Post, QStringLiteral("UploadKeysJob"), QStringLiteral("/_matrix/client/r0") % "/keys/upload") { QJsonObject _data; addParam(_data, QStringLiteral("device_keys"), deviceKeys); addParam(_data, QStringLiteral("one_time_keys"), oneTimeKeys); setRequestData(std::move(_data)); addExpectedKey("one_time_key_counts"); } QueryKeysJob::QueryKeysJob(const QHash& deviceKeys, Omittable timeout, const QString& token) : BaseJob(HttpVerb::Post, QStringLiteral("QueryKeysJob"), QStringLiteral("/_matrix/client/r0") % "/keys/query") { QJsonObject _data; addParam(_data, QStringLiteral("timeout"), timeout); addParam<>(_data, QStringLiteral("device_keys"), deviceKeys); addParam(_data, QStringLiteral("token"), token); setRequestData(std::move(_data)); } ClaimKeysJob::ClaimKeysJob( const QHash>& oneTimeKeys, Omittable timeout) : BaseJob(HttpVerb::Post, QStringLiteral("ClaimKeysJob"), QStringLiteral("/_matrix/client/r0") % "/keys/claim") { QJsonObject _data; addParam(_data, QStringLiteral("timeout"), timeout); addParam<>(_data, QStringLiteral("one_time_keys"), oneTimeKeys); setRequestData(std::move(_data)); addExpectedKey("one_time_keys"); } auto queryToGetKeysChanges(const QString& from, const QString& to) { BaseJob::Query _q; addParam<>(_q, QStringLiteral("from"), from); addParam<>(_q, QStringLiteral("to"), to); return _q; } QUrl GetKeysChangesJob::makeRequestUrl(QUrl baseUrl, const QString& from, const QString& to) { return BaseJob::makeRequestUrl(std::move(baseUrl), QStringLiteral("/_matrix/client/r0") % "/keys/changes", queryToGetKeysChanges(from, to)); } GetKeysChangesJob::GetKeysChangesJob(const QString& from, const QString& to) : BaseJob(HttpVerb::Get, QStringLiteral("GetKeysChangesJob"), QStringLiteral("/_matrix/client/r0") % "/keys/changes", queryToGetKeysChanges(from, to)) {} e/lib/csapi/users.cpp?id=6d40d7b8cc40259e451636e3a372de08d075553b'>users.cpp
blob: a0279d7e314a3878e3d56047cdb5cc3f66785c15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/******************************************************************************
 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
 */

#include "users.h"

#include <QtCore/QStringBuilder>

using namespace Quotient;

SearchUserDirectoryJob::SearchUserDirectoryJob(const QString& searchTerm,
                                               Omittable<int> limit)
    : BaseJob(HttpVerb::Post, QStringLiteral("SearchUserDirectoryJob"),
              QStringLiteral("/_matrix/client/r0") % "/user_directory/search")
{
    QJsonObject _data;
    addParam<>(_data, QStringLiteral("search_term"), searchTerm);
    addParam<IfNotEmpty>(_data, QStringLiteral("limit"), limit);
    setRequestData(std::move(_data));
    addExpectedKey("results");
    addExpectedKey("limited");
}