From 52afbb96cee8ea1aa739909fc54b28dd7dcb4a2f Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Tue, 27 Feb 2018 20:20:28 +0900 Subject: jobs/generated: SendMessageJob (might or might not preempt non-generated SendEventJob) --- jobs/generated/room_send.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ jobs/generated/room_send.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 jobs/generated/room_send.cpp create mode 100644 jobs/generated/room_send.h (limited to 'jobs/generated') diff --git a/jobs/generated/room_send.cpp b/jobs/generated/room_send.cpp new file mode 100644 index 00000000..c9a3280d --- /dev/null +++ b/jobs/generated/room_send.cpp @@ -0,0 +1,42 @@ +/****************************************************************************** + * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN + */ + +#include "room_send.h" + +#include "converters.h" + +#include + +using namespace QMatrixClient; + +static const auto basePath = QStringLiteral("/_matrix/client/r0"); + +class SendMessageJob::Private +{ + public: + QString eventId; +}; + +SendMessageJob::SendMessageJob(const QString& roomId, const QString& eventType, const QString& txnId, const QJsonObject& body) + : BaseJob(HttpVerb::Put, "SendMessageJob", + basePath % "/rooms/" % roomId % "/send/" % eventType % "/" % txnId) + , d(new Private) +{ + setRequestData(Data(body)); +} + +SendMessageJob::~SendMessageJob() = default; + +const QString& SendMessageJob::eventId() const +{ + return d->eventId; +} + +BaseJob::Status SendMessageJob::parseJson(const QJsonDocument& data) +{ + auto json = data.object(); + d->eventId = fromJson(json.value("event_id")); + return Success; +} + diff --git a/jobs/generated/room_send.h b/jobs/generated/room_send.h new file mode 100644 index 00000000..d20ce523 --- /dev/null +++ b/jobs/generated/room_send.h @@ -0,0 +1,31 @@ +/****************************************************************************** + * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN + */ + +#pragma once + +#include "../basejob.h" + +#include + + +namespace QMatrixClient +{ + // Operations + + class SendMessageJob : public BaseJob + { + public: + explicit SendMessageJob(const QString& roomId, const QString& eventType, const QString& txnId, const QJsonObject& body = {}); + ~SendMessageJob() override; + + const QString& eventId() const; + + protected: + Status parseJson(const QJsonDocument& data) override; + + private: + class Private; + QScopedPointer d; + }; +} // namespace QMatrixClient -- cgit v1.2.3