aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/create_room.cpp
blob: 9aaef87f7a5f51d614dcd42e4db923dee9411773 (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
34
35
36
37
38
39
/******************************************************************************
 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
 */

#include "create_room.h"

using namespace Quotient;

CreateRoomJob::CreateRoomJob(const QString& visibility,
                             const QString& roomAliasName, const QString& name,
                             const QString& topic, const QStringList& invite,
                             const QVector<Invite3pid>& invite3pid,
                             const QString& roomVersion,
                             const QJsonObject& creationContent,
                             const QVector<StateEvent>& initialState,
                             const QString& preset, Omittable<bool> isDirect,
                             const QJsonObject& powerLevelContentOverride)
    : BaseJob(HttpVerb::Post, QStringLiteral("CreateRoomJob"),
              makePath("/_matrix/client/r0", "/createRoom"))
{
    QJsonObject _data;
    addParam<IfNotEmpty>(_data, QStringLiteral("visibility"), visibility);
    addParam<IfNotEmpty>(_data, QStringLiteral("room_alias_name"),
                         roomAliasName);
    addParam<IfNotEmpty>(_data, QStringLiteral("name"), name);
    addParam<IfNotEmpty>(_data, QStringLiteral("topic"), topic);
    addParam<IfNotEmpty>(_data, QStringLiteral("invite"), invite);
    addParam<IfNotEmpty>(_data, QStringLiteral("invite_3pid"), invite3pid);
    addParam<IfNotEmpty>(_data, QStringLiteral("room_version"), roomVersion);
    addParam<IfNotEmpty>(_data, QStringLiteral("creation_content"),
                         creationContent);
    addParam<IfNotEmpty>(_data, QStringLiteral("initial_state"), initialState);
    addParam<IfNotEmpty>(_data, QStringLiteral("preset"), preset);
    addParam<IfNotEmpty>(_data, QStringLiteral("is_direct"), isDirect);
    addParam<IfNotEmpty>(_data, QStringLiteral("power_level_content_override"),
                         powerLevelContentOverride);
    setRequestData(std::move(_data));
    addExpectedKey("room_id");
}