1 | /****************************************************************************** |
2 | * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN |
3 | */ |
4 | |
5 | #include "room_event_by_timestamp.h" |
6 | |
7 | using namespace Quotient; |
8 | |
9 | auto queryToGetEventByTimestamp(int ts, const QString& dir) |
10 | { |
11 | QUrlQuery _q; |
12 | addParam<>(container&: _q, QStringLiteral("ts" ), value&: ts); |
13 | addParam<>(container&: _q, QStringLiteral("dir" ), value: dir); |
14 | return _q; |
15 | } |
16 | |
17 | QUrl GetEventByTimestampJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, |
18 | int ts, const QString& dir) |
19 | { |
20 | return BaseJob::makeRequestUrl(baseUrl: std::move(baseUrl), |
21 | encodedPath: makePath(parts: "/_matrix/client/v1" , parts: "/rooms/" , |
22 | parts: roomId, parts: "/timestamp_to_event" ), |
23 | query: queryToGetEventByTimestamp(ts, dir)); |
24 | } |
25 | |
26 | GetEventByTimestampJob::GetEventByTimestampJob(const QString& roomId, int ts, |
27 | const QString& dir) |
28 | : BaseJob(HttpVerb::Get, QStringLiteral("GetEventByTimestampJob" ), |
29 | makePath(parts: "/_matrix/client/v1" , parts: "/rooms/" , parts: roomId, |
30 | parts: "/timestamp_to_event" ), |
31 | queryToGetEventByTimestamp(ts, dir)) |
32 | { |
33 | addExpectedKey(key: "event_id" ); |
34 | addExpectedKey(key: "origin_server_ts" ); |
35 | } |
36 | |