aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/third_party_lookup.h
AgeCommit message (Expand)Author
2018-09-29Support CS API 0.4.0Kitsune Ral
2018-09-29Prepare for CS API 0.4.0Kitsune Ral
2018-08-25Update to the recent CS API (watch out for breakage)Kitsune Ral
2018-07-28csapi/third_party_lookup.*: Properly pass a variadic (aka exploded) parametersKitsune Ral
2018-07-21csapi: add definitions/auth_data.* and optimise out trivial files with the la...Kitsune Ral
2018-07-20csapi: Rename entities in application-service/Kitsune Ral
2018-07-18csapi: third_party_looku
/******************************************************************************
 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
 */

#include "account-data.h"

#include "converters.h"

#include <QtCore/QStringBuilder>

using namespace QMatrixClient;

static const auto basePath = QStringLiteral("/_matrix/client/r0");

static const auto SetAccountDataJobName = QStringLiteral("SetAccountDataJob");

SetAccountDataJob::SetAccountDataJob(const QString& userId, const QString& type, const QJsonObject& content)
    : BaseJob(HttpVerb::Put, SetAccountDataJobName,
        basePath % "/user/" % userId % "/account_data/" % type)
{
    setRequestData(Data(toJson(content)));
}

QUrl GetAccountDataJob::makeRequestUrl(QUrl baseUrl, const QString& userId, const QString& type)
{
    return BaseJob::makeRequestUrl(std::move(baseUrl),
            basePath % "/user/" % userId % "/account_data/" % type);
}

static const auto GetAccountDataJobName = QStringLiteral("GetAccountDataJob");

GetAccountDataJob::GetAccountDataJob(const QString& userId, const QString& type)
    : BaseJob(HttpVerb::Get, GetAccountDataJobName,
        basePath % "/user/" % userId % "/account_data/" % type)
{
}

static const auto SetAccountDataPerRoomJobName = QStringLiteral("SetAccountDataPerRoomJob");

SetAccountDataPerRoomJob::SetAccountDataPerRoomJob(const QString& userId, const QString& roomId, const QString& type, const QJsonObject& content)
    : BaseJob(HttpVerb::Put, SetAccountDataPerRoomJobName,
        basePath % "/user/" % userId % "/rooms/" % roomId % "/account_data/" % type)
{
    setRequestData(Data(toJson(content)));
}

QUrl GetAccountDataPerRoomJob::makeRequestUrl(QUrl baseUrl, const QString& userId, const QString& roomId, const QString& type)
{
    return BaseJob::makeRequestUrl(std::move(baseUrl),
            basePath % "/user/" % userId % "/rooms/" % roomId % "/account_data/" % type);
}

static const auto GetAccountDataPerRoomJobName = QStringLiteral("GetAccountDataPerRoomJob");

GetAccountDataPerRoomJob::GetAccountDataPerRoomJob(const QString& userId, const QString& roomId, const QString& type)
    : BaseJob(HttpVerb::Get, GetAccountDataPerRoomJobName,
        basePath % "/user/" % userId % "/rooms/" % roomId % "/account_data/" % type)
{
}