1 | /****************************************************************************** |
2 | * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN |
3 | */ |
4 | |
5 | #include "joining.h" |
6 | |
7 | using namespace Quotient; |
8 | |
9 | JoinRoomByIdJob::JoinRoomByIdJob( |
10 | const QString& roomId, const Omittable<ThirdPartySigned>& thirdPartySigned, |
11 | const QString& reason) |
12 | : BaseJob(HttpVerb::Post, QStringLiteral("JoinRoomByIdJob" ), |
13 | makePath(parts: "/_matrix/client/v3" , parts: "/rooms/" , parts: roomId, parts: "/join" )) |
14 | { |
15 | QJsonObject _dataJson; |
16 | addParam<IfNotEmpty>(container&: _dataJson, QStringLiteral("third_party_signed" ), |
17 | value: thirdPartySigned); |
18 | addParam<IfNotEmpty>(container&: _dataJson, QStringLiteral("reason" ), value: reason); |
19 | setRequestData({ _dataJson }); |
20 | addExpectedKey(key: "room_id" ); |
21 | } |
22 | |
23 | auto queryToJoinRoom(const QStringList& serverName) |
24 | { |
25 | QUrlQuery _q; |
26 | addParam<IfNotEmpty>(container&: _q, QStringLiteral("server_name" ), value: serverName); |
27 | return _q; |
28 | } |
29 | |
30 | JoinRoomJob::JoinRoomJob(const QString& roomIdOrAlias, |
31 | const QStringList& serverName, |
32 | const Omittable<ThirdPartySigned>& thirdPartySigned, |
33 | const QString& reason) |
34 | : BaseJob(HttpVerb::Post, QStringLiteral("JoinRoomJob" ), |
35 | makePath(parts: "/_matrix/client/v3" , parts: "/join/" , parts: roomIdOrAlias), |
36 | queryToJoinRoom(serverName)) |
37 | { |
38 | QJsonObject _dataJson; |
39 | addParam<IfNotEmpty>(container&: _dataJson, QStringLiteral("third_party_signed" ), |
40 | value: thirdPartySigned); |
41 | addParam<IfNotEmpty>(container&: _dataJson, QStringLiteral("reason" ), value: reason); |
42 | setRequestData({ _dataJson }); |
43 | addExpectedKey(key: "room_id" ); |
44 | } |
45 | |