1 | /****************************************************************************** |
2 | * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN |
3 | */ |
4 | |
5 | #include "presence.h" |
6 | |
7 | using namespace Quotient; |
8 | |
9 | SetPresenceJob::SetPresenceJob(const QString& userId, const QString& presence, |
10 | const QString& statusMsg) |
11 | : BaseJob(HttpVerb::Put, QStringLiteral("SetPresenceJob" ), |
12 | makePath(parts: "/_matrix/client/v3" , parts: "/presence/" , parts: userId, parts: "/status" )) |
13 | { |
14 | QJsonObject _dataJson; |
15 | addParam<>(container&: _dataJson, QStringLiteral("presence" ), value: presence); |
16 | addParam<IfNotEmpty>(container&: _dataJson, QStringLiteral("status_msg" ), value: statusMsg); |
17 | setRequestData({ _dataJson }); |
18 | } |
19 | |
20 | QUrl GetPresenceJob::makeRequestUrl(QUrl baseUrl, const QString& userId) |
21 | { |
22 | return BaseJob::makeRequestUrl(baseUrl: std::move(baseUrl), |
23 | encodedPath: makePath(parts: "/_matrix/client/v3" , parts: "/presence/" , |
24 | parts: userId, parts: "/status" )); |
25 | } |
26 | |
27 | GetPresenceJob::GetPresenceJob(const QString& userId) |
28 | : BaseJob(HttpVerb::Get, QStringLiteral("GetPresenceJob" ), |
29 | makePath(parts: "/_matrix/client/v3" , parts: "/presence/" , parts: userId, parts: "/status" )) |
30 | { |
31 | addExpectedKey(key: "presence" ); |
32 | } |
33 | |