1 | /****************************************************************************** |
2 | * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN |
3 | */ |
4 | |
5 | #include "knocking.h" |
6 | |
7 | using namespace Quotient; |
8 | |
9 | auto queryToKnockRoom(const QStringList& serverName) |
10 | { |
11 | QUrlQuery _q; |
12 | addParam<IfNotEmpty>(container&: _q, QStringLiteral("server_name" ), value: serverName); |
13 | return _q; |
14 | } |
15 | |
16 | KnockRoomJob::KnockRoomJob(const QString& roomIdOrAlias, |
17 | const QStringList& serverName, const QString& reason) |
18 | : BaseJob(HttpVerb::Post, QStringLiteral("KnockRoomJob" ), |
19 | makePath(parts: "/_matrix/client/v3" , parts: "/knock/" , parts: roomIdOrAlias), |
20 | queryToKnockRoom(serverName)) |
21 | { |
22 | QJsonObject _dataJson; |
23 | addParam<IfNotEmpty>(container&: _dataJson, QStringLiteral("reason" ), value: reason); |
24 | setRequestData({ _dataJson }); |
25 | addExpectedKey(key: "room_id" ); |
26 | } |
27 | |