aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/peeking_events.cpp
blob: eb5d22fab79d91a5f3ceb9079b5b0c7b9cda9e9c (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
/******************************************************************************
 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
 */

#include "peeking_events.h"

using namespace Quotient;

auto queryToPeekEvents(const QString& from, Omittable<int> timeout,
                       const QString& roomId)
{
    QUrlQuery _q;
    addParam<IfNotEmpty>(_q, QStringLiteral("from"), from);
    addParam<IfNotEmpty>(_q, QStringLiteral("timeout"), timeout);
    addParam<IfNotEmpty>(_q, QStringLiteral("room_id"), roomId);
    return _q;
}

QUrl PeekEventsJob::makeRequestUrl(QUrl baseUrl, const QString& from,
                                   Omittable<int> timeout, const QString& roomId)
{
    return BaseJob::makeRequestUrl(std::move(baseUrl),
                                   makePath("/_matrix/client/r0", "/events"),
                                   queryToPeekEvents(from, timeout, roomId));
}

PeekEventsJob::PeekEventsJob(const QString& from, Omittable<int> timeout,
                             const QString& roomId)
    : BaseJob(HttpVerb::Get, QStringLiteral("PeekEventsJob"),
              makePath("/_matrix/client/r0", "/events"),
              queryToPeekEvents(from, timeout, roomId))
{}