aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-05-04 23:04:04 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-05-04 23:04:04 +0900
commit49022915fde72b83d9f18944c268110b01fa3469 (patch)
tree1b465b553a2e341486cd6051530a63faba17288e /lib/csapi
parentf70ec41accd6da9f223bc41b446ad1d2d77de3f4 (diff)
downloadlibquotient-49022915fde72b83d9f18944c268110b01fa3469.tar.gz
libquotient-49022915fde72b83d9f18944c268110b01fa3469.zip
New home for the generated code - lib/csapi
Diffstat (limited to 'lib/csapi')
-rw-r--r--lib/csapi/account-data.cpp28
-rw-r--r--lib/csapi/account-data.h27
-rw-r--r--lib/csapi/admin.cpp100
-rw-r--r--lib/csapi/admin.h65
-rw-r--r--lib/csapi/administrative_contact.cpp102
-rw-r--r--lib/csapi/administrative_contact.h83
-rw-r--r--lib/csapi/banning.cpp34
-rw-r--r--lib/csapi/banning.h26
-rw-r--r--lib/csapi/content-repo.cpp254
-rw-r--r--lib/csapi/content-repo.h143
-rw-r--r--lib/csapi/create_room.cpp82
-rw-r--r--lib/csapi/create_room.h54
-rw-r--r--lib/csapi/directory.cpp76
-rw-r--r--lib/csapi/directory.h62
-rw-r--r--lib/csapi/event_context.cpp91
-rw-r--r--lib/csapi/event_context.h46
-rw-r--r--lib/csapi/gtad.yaml139
-rw-r--r--lib/csapi/inviting.cpp23
-rw-r--r--lib/csapi/inviting.h20
-rw-r--r--lib/csapi/joining.cpp118
-rw-r--r--lib/csapi/joining.h81
-rw-r--r--lib/csapi/kicking.cpp25
-rw-r--r--lib/csapi/kicking.h20
-rw-r--r--lib/csapi/leaving.cpp38
-rw-r--r--lib/csapi/leaving.h42
-rw-r--r--lib/csapi/list_joined_rooms.cpp50
-rw-r--r--lib/csapi/list_joined_rooms.h41
-rw-r--r--lib/csapi/list_public_rooms.cpp268
-rw-r--r--lib/csapi/list_public_rooms.h138
-rw-r--r--lib/csapi/login.cpp79
-rw-r--r--lib/csapi/login.h35
-rw-r--r--lib/csapi/logout.cpp26
-rw-r--r--lib/csapi/logout.h28
-rw-r--r--lib/csapi/message_pagination.cpp76
-rw-r--r--lib/csapi/message_pagination.h43
-rw-r--r--lib/csapi/notifications.cpp96
-rw-r--r--lib/csapi/notifications.h59
-rw-r--r--lib/csapi/preamble.mustache3
-rw-r--r--lib/csapi/profile.cpp140
-rw-r--r--lib/csapi/profile.h105
-rw-r--r--lib/csapi/pusher.cpp121
-rw-r--r--lib/csapi/pusher.h78
-rw-r--r--lib/csapi/receipts.cpp21
-rw-r--r--lib/csapi/receipts.h21
-rw-r--r--lib/csapi/redaction.cpp45
-rw-r--r--lib/csapi/redaction.h32
-rw-r--r--lib/csapi/room_send.cpp42
-rw-r--r--lib/csapi/room_send.h33
-rw-r--r--lib/csapi/room_state.cpp70
-rw-r--r--lib/csapi/room_state.h51
-rw-r--r--lib/csapi/tags.cpp66
-rw-r--r--lib/csapi/tags.h61
-rw-r--r--lib/csapi/third_party_membership.cpp25
-rw-r--r--lib/csapi/third_party_membership.h20
-rw-r--r--lib/csapi/to_device.cpp23
-rw-r--r--lib/csapi/to_device.h22
-rw-r--r--lib/csapi/typing.cpp24
-rw-r--r--lib/csapi/typing.h20
-rw-r--r--lib/csapi/users.cpp78
-rw-r--r--lib/csapi/users.h46
-rw-r--r--lib/csapi/versions.cpp47
-rw-r--r--lib/csapi/versions.h41
-rw-r--r--lib/csapi/whoami.cpp50
-rw-r--r--lib/csapi/whoami.h40
-rw-r--r--lib/csapi/{{base}}.cpp.mustache121
-rw-r--r--lib/csapi/{{base}}.h.mustache63
66 files changed, 4227 insertions, 0 deletions
diff --git a/lib/csapi/account-data.cpp b/lib/csapi/account-data.cpp
new file mode 100644
index 00000000..ac45cb85
--- /dev/null
+++ b/lib/csapi/account-data.cpp
@@ -0,0 +1,28 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "account-data.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+SetAccountDataJob::SetAccountDataJob(const QString& userId, const QString& type, const QJsonObject& content)
+ : BaseJob(HttpVerb::Put, "SetAccountDataJob",
+ basePath % "/user/" % userId % "/account_data/" % type)
+{
+ setRequestData(Data(toJson(content)));
+}
+
+SetAccountDataPerRoomJob::SetAccountDataPerRoomJob(const QString& userId, const QString& roomId, const QString& type, const QJsonObject& content)
+ : BaseJob(HttpVerb::Put, "SetAccountDataPerRoomJob",
+ basePath % "/user/" % userId % "/rooms/" % roomId % "/account_data/" % type)
+{
+ setRequestData(Data(toJson(content)));
+}
+
diff --git a/lib/csapi/account-data.h b/lib/csapi/account-data.h
new file mode 100644
index 00000000..784b8b4b
--- /dev/null
+++ b/lib/csapi/account-data.h
@@ -0,0 +1,27 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include <QtCore/QJsonObject>
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class SetAccountDataJob : public BaseJob
+ {
+ public:
+ explicit SetAccountDataJob(const QString& userId, const QString& type, const QJsonObject& content = {});
+ };
+
+ class SetAccountDataPerRoomJob : public BaseJob
+ {
+ public:
+ explicit SetAccountDataPerRoomJob(const QString& userId, const QString& roomId, const QString& type, const QJsonObject& content = {});
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/admin.cpp b/lib/csapi/admin.cpp
new file mode 100644
index 00000000..b325d746
--- /dev/null
+++ b/lib/csapi/admin.cpp
@@ -0,0 +1,100 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "admin.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+namespace QMatrixClient
+{
+ // Converters
+
+ template <> struct FromJson<GetWhoIsJob::ConnectionInfo>
+ {
+ GetWhoIsJob::ConnectionInfo operator()(const QJsonValue& jv)
+ {
+ const auto& o = jv.toObject();
+ GetWhoIsJob::ConnectionInfo result;
+ result.ip =
+ fromJson<QString>(o.value("ip"));
+ result.lastSeen =
+ fromJson<qint64>(o.value("last_seen"));
+ result.userAgent =
+ fromJson<QString>(o.value("user_agent"));
+
+ return result;
+ }
+ };
+
+ template <> struct FromJson<GetWhoIsJob::SessionInfo>
+ {
+ GetWhoIsJob::SessionInfo operator()(const QJsonValue& jv)
+ {
+ const auto& o = jv.toObject();
+ GetWhoIsJob::SessionInfo result;
+ result.connections =
+ fromJson<QVector<GetWhoIsJob::ConnectionInfo>>(o.value("connections"));
+
+ return result;
+ }
+ };
+
+ template <> struct FromJson<GetWhoIsJob::DeviceInfo>
+ {
+ GetWhoIsJob::DeviceInfo operator()(const QJsonValue& jv)
+ {
+ const auto& o = jv.toObject();
+ GetWhoIsJob::DeviceInfo result;
+ result.sessions =
+ fromJson<QVector<GetWhoIsJob::SessionInfo>>(o.value("sessions"));
+
+ return result;
+ }
+ };
+} // namespace QMatrixClient
+
+class GetWhoIsJob::Private
+{
+ public:
+ QString userId;
+ QHash<QString, DeviceInfo> devices;
+};
+
+QUrl GetWhoIsJob::makeRequestUrl(QUrl baseUrl, const QString& userId)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/admin/whois/" % userId);
+}
+
+GetWhoIsJob::GetWhoIsJob(const QString& userId)
+ : BaseJob(HttpVerb::Get, "GetWhoIsJob",
+ basePath % "/admin/whois/" % userId)
+ , d(new Private)
+{
+}
+
+GetWhoIsJob::~GetWhoIsJob() = default;
+
+const QString& GetWhoIsJob::userId() const
+{
+ return d->userId;
+}
+
+const QHash<QString, GetWhoIsJob::DeviceInfo>& GetWhoIsJob::devices() const
+{
+ return d->devices;
+}
+
+BaseJob::Status GetWhoIsJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ d->userId = fromJson<QString>(json.value("user_id"));
+ d->devices = fromJson<QHash<QString, DeviceInfo>>(json.value("devices"));
+ return Success;
+}
+
diff --git a/lib/csapi/admin.h b/lib/csapi/admin.h
new file mode 100644
index 00000000..ada5a8ca
--- /dev/null
+++ b/lib/csapi/admin.h
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include <QtCore/QHash>
+#include <QtCore/QVector>
+
+#include "converters.h"
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class GetWhoIsJob : public BaseJob
+ {
+ public:
+ // Inner data structures
+
+ struct ConnectionInfo
+ {
+ QString ip;
+ qint64 lastSeen;
+ QString userAgent;
+ };
+
+ struct SessionInfo
+ {
+ QVector<ConnectionInfo> connections;
+ };
+
+ struct DeviceInfo
+ {
+ QVector<SessionInfo> sessions;
+ };
+
+ // Construction/destruction
+
+ explicit GetWhoIsJob(const QString& userId);
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetWhoIsJob. This function can be used when
+ * a URL for GetWhoIsJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId);
+
+ ~GetWhoIsJob() override;
+
+ // Result properties
+
+ const QString& userId() const;
+ const QHash<QString, DeviceInfo>& devices() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/administrative_contact.cpp b/lib/csapi/administrative_contact.cpp
new file mode 100644
index 00000000..ec7c77c3
--- /dev/null
+++ b/lib/csapi/administrative_contact.cpp
@@ -0,0 +1,102 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "administrative_contact.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+namespace QMatrixClient
+{
+ // Converters
+
+ template <> struct FromJson<GetAccount3PIDsJob::ThirdPartyIdentifier>
+ {
+ GetAccount3PIDsJob::ThirdPartyIdentifier operator()(const QJsonValue& jv)
+ {
+ const auto& o = jv.toObject();
+ GetAccount3PIDsJob::ThirdPartyIdentifier result;
+ result.medium =
+ fromJson<QString>(o.value("medium"));
+ result.address =
+ fromJson<QString>(o.value("address"));
+
+ return result;
+ }
+ };
+} // namespace QMatrixClient
+
+class GetAccount3PIDsJob::Private
+{
+ public:
+ QVector<ThirdPartyIdentifier> threepids;
+};
+
+QUrl GetAccount3PIDsJob::makeRequestUrl(QUrl baseUrl)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/account/3pid");
+}
+
+GetAccount3PIDsJob::GetAccount3PIDsJob()
+ : BaseJob(HttpVerb::Get, "GetAccount3PIDsJob",
+ basePath % "/account/3pid")
+ , d(new Private)
+{
+}
+
+GetAccount3PIDsJob::~GetAccount3PIDsJob() = default;
+
+const QVector<GetAccount3PIDsJob::ThirdPartyIdentifier>& GetAccount3PIDsJob::threepids() const
+{
+ return d->threepids;
+}
+
+BaseJob::Status GetAccount3PIDsJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ d->threepids = fromJson<QVector<ThirdPartyIdentifier>>(json.value("threepids"));
+ return Success;
+}
+
+namespace QMatrixClient
+{
+ // Converters
+
+ QJsonObject toJson(const Post3PIDsJob::ThreePidCredentials& pod)
+ {
+ QJsonObject o;
+ o.insert("client_secret", toJson(pod.clientSecret));
+ o.insert("id_server", toJson(pod.idServer));
+ o.insert("sid", toJson(pod.sid));
+
+ return o;
+ }
+} // namespace QMatrixClient
+
+Post3PIDsJob::Post3PIDsJob(const ThreePidCredentials& threePidCreds, bool bind)
+ : BaseJob(HttpVerb::Post, "Post3PIDsJob",
+ basePath % "/account/3pid")
+{
+ QJsonObject _data;
+ _data.insert("three_pid_creds", toJson(threePidCreds));
+ _data.insert("bind", toJson(bind));
+ setRequestData(_data);
+}
+
+QUrl RequestTokenTo3PIDJob::makeRequestUrl(QUrl baseUrl)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/account/3pid/email/requestToken");
+}
+
+RequestTokenTo3PIDJob::RequestTokenTo3PIDJob()
+ : BaseJob(HttpVerb::Post, "RequestTokenTo3PIDJob",
+ basePath % "/account/3pid/email/requestToken", false)
+{
+}
+
diff --git a/lib/csapi/administrative_contact.h b/lib/csapi/administrative_contact.h
new file mode 100644
index 00000000..0d1ace3d
--- /dev/null
+++ b/lib/csapi/administrative_contact.h
@@ -0,0 +1,83 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include <QtCore/QVector>
+
+#include "converters.h"
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class GetAccount3PIDsJob : public BaseJob
+ {
+ public:
+ // Inner data structures
+
+ struct ThirdPartyIdentifier
+ {
+ QString medium;
+ QString address;
+ };
+
+ // Construction/destruction
+
+ explicit GetAccount3PIDsJob();
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetAccount3PIDsJob. This function can be used when
+ * a URL for GetAccount3PIDsJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl);
+
+ ~GetAccount3PIDsJob() override;
+
+ // Result properties
+
+ const QVector<ThirdPartyIdentifier>& threepids() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+
+ class Post3PIDsJob : public BaseJob
+ {
+ public:
+ // Inner data structures
+
+ struct ThreePidCredentials
+ {
+ QString clientSecret;
+ QString idServer;
+ QString sid;
+ };
+
+ // Construction/destruction
+
+ explicit Post3PIDsJob(const ThreePidCredentials& threePidCreds, bool bind = {});
+ };
+
+ class RequestTokenTo3PIDJob : public BaseJob
+ {
+ public:
+ explicit RequestTokenTo3PIDJob();
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * RequestTokenTo3PIDJob. This function can be used when
+ * a URL for RequestTokenTo3PIDJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl);
+
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/banning.cpp b/lib/csapi/banning.cpp
new file mode 100644
index 00000000..f66b27b6
--- /dev/null
+++ b/lib/csapi/banning.cpp
@@ -0,0 +1,34 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "banning.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+BanJob::BanJob(const QString& roomId, const QString& userId, const QString& reason)
+ : BaseJob(HttpVerb::Post, "BanJob",
+ basePath % "/rooms/" % roomId % "/ban")
+{
+ QJsonObject _data;
+ _data.insert("user_id", toJson(userId));
+ if (!reason.isEmpty())
+ _data.insert("reason", toJson(reason));
+ setRequestData(_data);
+}
+
+UnbanJob::UnbanJob(const QString& roomId, const QString& userId)
+ : BaseJob(HttpVerb::Post, "UnbanJob",
+ basePath % "/rooms/" % roomId % "/unban")
+{
+ QJsonObject _data;
+ _data.insert("user_id", toJson(userId));
+ setRequestData(_data);
+}
+
diff --git a/lib/csapi/banning.h b/lib/csapi/banning.h
new file mode 100644
index 00000000..5d9bae2b
--- /dev/null
+++ b/lib/csapi/banning.h
@@ -0,0 +1,26 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class BanJob : public BaseJob
+ {
+ public:
+ explicit BanJob(const QString& roomId, const QString& userId, const QString& reason = {});
+ };
+
+ class UnbanJob : public BaseJob
+ {
+ public:
+ explicit UnbanJob(const QString& roomId, const QString& userId);
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/content-repo.cpp b/lib/csapi/content-repo.cpp
new file mode 100644
index 00000000..95fc5aed
--- /dev/null
+++ b/lib/csapi/content-repo.cpp
@@ -0,0 +1,254 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "content-repo.h"
+
+#include "converters.h"
+
+#include <QtNetwork/QNetworkReply>
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/media/r0");
+
+class UploadContentJob::Private
+{
+ public:
+ QString contentUri;
+};
+
+BaseJob::Query queryToUploadContent(const QString& filename)
+{
+ BaseJob::Query _q;
+ if (!filename.isEmpty())
+ _q.addQueryItem("filename", filename);
+ return _q;
+}
+
+UploadContentJob::UploadContentJob(QIODevice* content, const QString& filename, const QString& contentType)
+ : BaseJob(HttpVerb::Post, "UploadContentJob",
+ basePath % "/upload",
+ queryToUploadContent(filename))
+ , d(new Private)
+{
+ setRequestHeader("Content-Type", contentType.toLatin1());
+
+ setRequestData(Data(content));
+}
+
+UploadContentJob::~UploadContentJob() = default;
+
+const QString& UploadContentJob::contentUri() const
+{
+ return d->contentUri;
+}
+
+BaseJob::Status UploadContentJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ if (!json.contains("content_uri"))
+ return { JsonParseError,
+ "The key 'content_uri' not found in the response" };
+ d->contentUri = fromJson<QString>(json.value("content_uri"));
+ return Success;
+}
+
+class GetContentJob::Private
+{
+ public:
+ QString contentType;
+ QString contentDisposition;
+ QIODevice* content;
+};
+
+QUrl GetContentJob::makeRequestUrl(QUrl baseUrl, const QString& serverName, const QString& mediaId)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/download/" % serverName % "/" % mediaId);
+}
+
+GetContentJob::GetContentJob(const QString& serverName, const QString& mediaId)
+ : BaseJob(HttpVerb::Get, "GetContentJob",
+ basePath % "/download/" % serverName % "/" % mediaId, false)
+ , d(new Private)
+{
+ setExpectedContentTypes({ "*/*" });
+}
+
+GetContentJob::~GetContentJob() = default;
+
+const QString& GetContentJob::contentType() const
+{
+ return d->contentType;
+}
+
+const QString& GetContentJob::contentDisposition() const
+{
+ return d->contentDisposition;
+}
+
+QIODevice* GetContentJob::content() const
+{
+ return d->content;
+}
+
+BaseJob::Status GetContentJob::parseReply(QNetworkReply* reply)
+{
+ d->contentType = reply->rawHeader("Content-Type");
+ d->contentDisposition = reply->rawHeader("Content-Disposition");
+ d->content = reply;
+ return Success;
+}
+
+class GetContentOverrideNameJob::Private
+{
+ public:
+ QString contentType;
+ QString contentDisposition;
+ QIODevice* content;
+};
+
+QUrl GetContentOverrideNameJob::makeRequestUrl(QUrl baseUrl, const QString& serverName, const QString& mediaId, const QString& fileName)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/download/" % serverName % "/" % mediaId % "/" % fileName);
+}
+
+GetContentOverrideNameJob::GetContentOverrideNameJob(const QString& serverName, const QString& mediaId, const QString& fileName)
+ : BaseJob(HttpVerb::Get, "GetContentOverrideNameJob",
+ basePath % "/download/" % serverName % "/" % mediaId % "/" % fileName, false)
+ , d(new Private)
+{
+ setExpectedContentTypes({ "*/*" });
+}
+
+GetContentOverrideNameJob::~GetContentOverrideNameJob() = default;
+
+const QString& GetContentOverrideNameJob::contentType() const
+{
+ return d->contentType;
+}
+
+const QString& GetContentOverrideNameJob::contentDisposition() const
+{
+ return d->contentDisposition;
+}
+
+QIODevice* GetContentOverrideNameJob::content() const
+{
+ return d->content;
+}
+
+BaseJob::Status GetContentOverrideNameJob::parseReply(QNetworkReply* reply)
+{
+ d->contentType = reply->rawHeader("Content-Type");
+ d->contentDisposition = reply->rawHeader("Content-Disposition");
+ d->content = reply;
+ return Success;
+}
+
+class GetContentThumbnailJob::Private
+{
+ public:
+ QString contentType;
+ QIODevice* content;
+};
+
+BaseJob::Query queryToGetContentThumbnail(int width, int height, const QString& method)
+{
+ BaseJob::Query _q;
+ _q.addQueryItem("width", QString("%1").arg(width));
+ _q.addQueryItem("height", QString("%1").arg(height));
+ if (!method.isEmpty())
+ _q.addQueryItem("method", method);
+ return _q;
+}
+
+QUrl GetContentThumbnailJob::makeRequestUrl(QUrl baseUrl, const QString& serverName, const QString& mediaId, int width, int height, const QString& method)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/thumbnail/" % serverName % "/" % mediaId,
+ queryToGetContentThumbnail(width, height, method));
+}
+
+GetContentThumbnailJob::GetContentThumbnailJob(const QString& serverName, const QString& mediaId, int width, int height, const QString& method)
+ : BaseJob(HttpVerb::Get, "GetContentThumbnailJob",
+ basePath % "/thumbnail/" % serverName % "/" % mediaId,
+ queryToGetContentThumbnail(width, height, method),
+ {}, false)
+ , d(new Private)
+{
+ setExpectedContentTypes({ "image/jpeg", "image/png" });
+}
+
+GetContentThumbnailJob::~GetContentThumbnailJob() = default;
+
+const QString& GetContentThumbnailJob::contentType() const
+{
+ return d->contentType;
+}
+
+QIODevice* GetContentThumbnailJob::content() const
+{
+ return d->content;
+}
+
+BaseJob::Status GetContentThumbnailJob::parseReply(QNetworkReply* reply)
+{
+ d->contentType = reply->rawHeader("Content-Type");
+ d->content = reply;
+ return Success;
+}
+
+class GetUrlPreviewJob::Private
+{
+ public:
+ qint64 matrixImageSize;
+ QString ogImage;
+};
+
+BaseJob::Query queryToGetUrlPreview(const QString& url, qint64 ts)
+{
+ BaseJob::Query _q;
+ _q.addQueryItem("url", url);
+ _q.addQueryItem("ts", QString("%1").arg(ts));
+ return _q;
+}
+
+QUrl GetUrlPreviewJob::makeRequestUrl(QUrl baseUrl, const QString& url, qint64 ts)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/preview_url",
+ queryToGetUrlPreview(url, ts));
+}
+
+GetUrlPreviewJob::GetUrlPreviewJob(const QString& url, qint64 ts)
+ : BaseJob(HttpVerb::Get, "GetUrlPreviewJob",
+ basePath % "/preview_url",
+ queryToGetUrlPreview(url, ts))
+ , d(new Private)
+{
+}
+
+GetUrlPreviewJob::~GetUrlPreviewJob() = default;
+
+qint64 GetUrlPreviewJob::matrixImageSize() const
+{
+ return d->matrixImageSize;
+}
+
+const QString& GetUrlPreviewJob::ogImage() const
+{
+ return d->ogImage;
+}
+
+BaseJob::Status GetUrlPreviewJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ d->matrixImageSize = fromJson<qint64>(json.value("matrix:image:size"));
+ d->ogImage = fromJson<QString>(json.value("og:image"));
+ return Success;
+}
+
diff --git a/lib/csapi/content-repo.h b/lib/csapi/content-repo.h
new file mode 100644
index 00000000..4c799b2d
--- /dev/null
+++ b/lib/csapi/content-repo.h
@@ -0,0 +1,143 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include <QtCore/QIODevice>
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class UploadContentJob : public BaseJob
+ {
+ public:
+ explicit UploadContentJob(QIODevice* content, const QString& filename = {}, const QString& contentType = {});
+ ~UploadContentJob() override;
+
+ // Result properties
+
+ const QString& contentUri() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+
+ class GetContentJob : public BaseJob
+ {
+ public:
+ explicit GetContentJob(const QString& serverName, const QString& mediaId);
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetContentJob. This function can be used when
+ * a URL for GetContentJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& serverName, const QString& mediaId);
+
+ ~GetContentJob() override;
+
+ // Result properties
+
+ const QString& contentType() const;
+ const QString& contentDisposition() const;
+ QIODevice* content() const;
+
+ protected:
+ Status parseReply(QNetworkReply* reply) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+
+ class GetContentOverrideNameJob : public BaseJob
+ {
+ public:
+ explicit GetContentOverrideNameJob(const QString& serverName, const QString& mediaId, const QString& fileName);
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetContentOverrideNameJob. This function can be used when
+ * a URL for GetContentOverrideNameJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& serverName, const QString& mediaId, const QString& fileName);
+
+ ~GetContentOverrideNameJob() override;
+
+ // Result properties
+
+ const QString& contentType() const;
+ const QString& contentDisposition() const;
+ QIODevice* content() const;
+
+ protected:
+ Status parseReply(QNetworkReply* reply) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+
+ class GetContentThumbnailJob : public BaseJob
+ {
+ public:
+ explicit GetContentThumbnailJob(const QString& serverName, const QString& mediaId, int width = {}, int height = {}, const QString& method = {});
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetContentThumbnailJob. This function can be used when
+ * a URL for GetContentThumbnailJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& serverName, const QString& mediaId, int width = {}, int height = {}, const QString& method = {});
+
+ ~GetContentThumbnailJob() override;
+
+ // Result properties
+
+ const QString& contentType() const;
+ QIODevice* content() const;
+
+ protected:
+ Status parseReply(QNetworkReply* reply) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+
+ class GetUrlPreviewJob : public BaseJob
+ {
+ public:
+ explicit GetUrlPreviewJob(const QString& url, qint64 ts = {});
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetUrlPreviewJob. This function can be used when
+ * a URL for GetUrlPreviewJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& url, qint64 ts = {});
+
+ ~GetUrlPreviewJob() override;
+
+ // Result properties
+
+ qint64 matrixImageSize() const;
+ const QString& ogImage() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/create_room.cpp b/lib/csapi/create_room.cpp
new file mode 100644
index 00000000..0a7eb208
--- /dev/null
+++ b/lib/csapi/create_room.cpp
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "create_room.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+namespace QMatrixClient
+{
+ // Converters
+
+ QJsonObject toJson(const CreateRoomJob::Invite3pid& pod)
+ {
+ QJsonObject o;
+ o.insert("id_server", toJson(pod.idServer));
+ o.insert("medium", toJson(pod.medium));
+ o.insert("address", toJson(pod.address));
+
+ return o;
+ }
+
+ QJsonObject toJson(const CreateRoomJob::StateEvent& pod)
+ {
+ QJsonObject o;
+ o.insert("type", toJson(pod.type));
+ o.insert("state_key", toJson(pod.stateKey));
+ o.insert("content", toJson(pod.content));
+
+ return o;
+ }
+} // namespace QMatrixClient
+
+class CreateRoomJob::Private
+{
+ public:
+ QString roomId;
+};
+
+CreateRoomJob::CreateRoomJob(const QString& visibility, const QString& roomAliasName, const QString& name, const QString& topic, const QStringList& invite, const QVector<Invite3pid>& invite3pid, const QJsonObject& creationContent, const QVector<StateEvent>& initialState, const QString& preset, bool isDirect, bool guestCanJoin)
+ : BaseJob(HttpVerb::Post, "CreateRoomJob",
+ basePath % "/createRoom")
+ , d(new Private)
+{
+ QJsonObject _data;
+ if (!visibility.isEmpty())
+ _data.insert("visibility", toJson(visibility));
+ if (!roomAliasName.isEmpty())
+ _data.insert("room_alias_name", toJson(roomAliasName));
+ if (!name.isEmpty())
+ _data.insert("name", toJson(name));
+ if (!topic.isEmpty())
+ _data.insert("topic", toJson(topic));
+ _data.insert("invite", toJson(invite));
+ _data.insert("invite_3pid", toJson(invite3pid));
+ _data.insert("creation_content", toJson(creationContent));
+ _data.insert("initial_state", toJson(initialState));
+ if (!preset.isEmpty())
+ _data.insert("preset", toJson(preset));
+ _data.insert("is_direct", toJson(isDirect));
+ _data.insert("guest_can_join", toJson(guestCanJoin));
+ setRequestData(_data);
+}
+
+CreateRoomJob::~CreateRoomJob() = default;
+
+const QString& CreateRoomJob::roomId() const
+{
+ return d->roomId;
+}
+
+BaseJob::Status CreateRoomJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ d->roomId = fromJson<QString>(json.value("room_id"));
+ return Success;
+}
+
diff --git a/lib/csapi/create_room.h b/lib/csapi/create_room.h
new file mode 100644
index 00000000..8ade7a9c
--- /dev/null
+++ b/lib/csapi/create_room.h
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include <QtCore/QVector>
+#include <QtCore/QJsonObject>
+#include <QtCore/QStringList>
+
+#include "converters.h"
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class CreateRoomJob : public BaseJob
+ {
+ public:
+ // Inner data structures
+
+ struct Invite3pid
+ {
+ QString idServer;
+ QString medium;
+ QString address;
+ };
+
+ struct StateEvent
+ {
+ QString type;
+ QString stateKey;
+ QJsonObject content;
+ };
+
+ // Construction/destruction
+
+ explicit CreateRoomJob(const QString& visibility = {}, const QString& roomAliasName = {}, const QString& name = {}, const QString& topic = {}, const QStringList& invite = {}, const QVector<Invite3pid>& invite3pid = {}, const QJsonObject& creationContent = {}, const QVector<StateEvent>& initialState = {}, const QString& preset = {}, bool isDirect = {}, bool guestCanJoin = {});
+ ~CreateRoomJob() override;
+
+ // Result properties
+
+ const QString& roomId() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/directory.cpp b/lib/csapi/directory.cpp
new file mode 100644
index 00000000..3066ebe2
--- /dev/null
+++ b/lib/csapi/directory.cpp
@@ -0,0 +1,76 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "directory.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0/directory");
+
+SetRoomAliasJob::SetRoomAliasJob(const QString& roomAlias, const QString& roomId)
+ : BaseJob(HttpVerb::Put, "SetRoomAliasJob",
+ basePath % "/room/" % roomAlias)
+{
+ QJsonObject _data;
+ if (!roomId.isEmpty())
+ _data.insert("room_id", toJson(roomId));
+ setRequestData(_data);
+}
+
+class GetRoomIdByAliasJob::Private
+{
+ public:
+ QString roomId;
+ QStringList servers;
+};
+
+QUrl GetRoomIdByAliasJob::makeRequestUrl(QUrl baseUrl, const QString& roomAlias)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/room/" % roomAlias);
+}
+
+GetRoomIdByAliasJob::GetRoomIdByAliasJob(const QString& roomAlias)
+ : BaseJob(HttpVerb::Get, "GetRoomIdByAliasJob",
+ basePath % "/room/" % roomAlias, false)
+ , d(new Private)
+{
+}
+
+GetRoomIdByAliasJob::~GetRoomIdByAliasJob() = default;
+
+const QString& GetRoomIdByAliasJob::roomId() const
+{
+ return d->roomId;
+}
+
+const QStringList& GetRoomIdByAliasJob::servers() const
+{
+ return d->servers;
+}
+
+BaseJob::Status GetRoomIdByAliasJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ d->roomId = fromJson<QString>(json.value("room_id"));
+ d->servers = fromJson<QStringList>(json.value("servers"));
+ return Success;
+}
+
+QUrl DeleteRoomAliasJob::makeRequestUrl(QUrl baseUrl, const QString& roomAlias)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/room/" % roomAlias);
+}
+
+DeleteRoomAliasJob::DeleteRoomAliasJob(const QString& roomAlias)
+ : BaseJob(HttpVerb::Delete, "DeleteRoomAliasJob",
+ basePath % "/room/" % roomAlias)
+{
+}
+
diff --git a/lib/csapi/directory.h b/lib/csapi/directory.h
new file mode 100644
index 00000000..b6e62b6a
--- /dev/null
+++ b/lib/csapi/directory.h
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include <QtCore/QStringList>
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class SetRoomAliasJob : public BaseJob
+ {
+ public:
+ explicit SetRoomAliasJob(const QString& roomAlias, const QString& roomId = {});
+ };
+
+ class GetRoomIdByAliasJob : public BaseJob
+ {
+ public:
+ explicit GetRoomIdByAliasJob(const QString& roomAlias);
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetRoomIdByAliasJob. This function can be used when
+ * a URL for GetRoomIdByAliasJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& roomAlias);
+
+ ~GetRoomIdByAliasJob() override;
+
+ // Result properties
+
+ const QString& roomId() const;
+ const QStringList& servers() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+
+ class DeleteRoomAliasJob : public BaseJob
+ {
+ public:
+ explicit DeleteRoomAliasJob(const QString& roomAlias);
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * DeleteRoomAliasJob. This function can be used when
+ * a URL for DeleteRoomAliasJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& roomAlias);
+
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/event_context.cpp b/lib/csapi/event_context.cpp
new file mode 100644
index 00000000..d9ab45ca
--- /dev/null
+++ b/lib/csapi/event_context.cpp
@@ -0,0 +1,91 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "event_context.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+class GetEventContextJob::Private
+{
+ public:
+ QString begin;
+ QString end;
+ RoomEvents eventsBefore;
+ RoomEventPtr event;
+ RoomEvents eventsAfter;
+ StateEvents state;
+};
+
+BaseJob::Query queryToGetEventContext(int limit)
+{
+ BaseJob::Query _q;
+ _q.addQueryItem("limit", QString("%1").arg(limit));
+ return _q;
+}
+
+QUrl GetEventContextJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& eventId, int limit)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/rooms/" % roomId % "/context/" % eventId,
+ queryToGetEventContext(limit));
+}
+
+GetEventContextJob::GetEventContextJob(const QString& roomId, const QString& eventId, int limit)
+ : BaseJob(HttpVerb::Get, "GetEventContextJob",
+ basePath % "/rooms/" % roomId % "/context/" % eventId,
+ queryToGetEventContext(limit))
+ , d(new Private)
+{
+}
+
+GetEventContextJob::~GetEventContextJob() = default;
+
+const QString& GetEventContextJob::begin() const
+{
+ return d->begin;
+}
+
+const QString& GetEventContextJob::end() const
+{
+ return d->end;
+}
+
+RoomEvents&& GetEventContextJob::eventsBefore()
+{
+ return std::move(d->eventsBefore);
+}
+
+RoomEventPtr&& GetEventContextJob::event()
+{
+ return std::move(d->event);
+}
+
+RoomEvents&& GetEventContextJob::eventsAfter()
+{
+ return std::move(d->eventsAfter);
+}
+
+StateEvents&& GetEventContextJob::state()
+{
+ return std::move(d->state);
+}
+
+BaseJob::Status GetEventContextJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ d->begin = fromJson<QString>(json.value("start"));
+ d->end = fromJson<QString>(json.value("end"));
+ d->eventsBefore = fromJson<RoomEvents>(json.value("events_before"));
+ d->event = fromJson<RoomEventPtr>(json.value("event"));
+ d->eventsAfter = fromJson<RoomEvents>(json.value("events_after"));
+ d->state = fromJson<StateEvents>(json.value("state"));
+ return Success;
+}
+
diff --git a/lib/csapi/event_context.h b/lib/csapi/event_context.h
new file mode 100644
index 00000000..caf1dfd4
--- /dev/null
+++ b/lib/csapi/event_context.h
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include "events/event.h"
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class GetEventContextJob : public BaseJob
+ {
+ public:
+ explicit GetEventContextJob(const QString& roomId, const QString& eventId, int limit = {});
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetEventContextJob. This function can be used when
+ * a URL for GetEventContextJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& eventId, int limit = {});
+
+ ~GetEventContextJob() override;
+
+ // Result properties
+
+ const QString& begin() const;
+ const QString& end() const;
+ RoomEvents&& eventsBefore();
+ RoomEventPtr&& event();
+ RoomEvents&& eventsAfter();
+ StateEvents&& state();
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/gtad.yaml b/lib/csapi/gtad.yaml
new file mode 100644
index 00000000..7f6a97e0
--- /dev/null
+++ b/lib/csapi/gtad.yaml
@@ -0,0 +1,139 @@
+analyzer:
+ subst:
+ "%CLIENT_RELEASE_LABEL%": r0
+ "%CLIENT_MAJOR_VERSION%": r0
+ identifiers:
+ signed: signedData
+ unsigned: unsignedData
+ default: isDefault
+ origin_server_ts: originServerTimestamp # Instead of originServerTs
+ start: begin # Because start() is a method in BaseJob
+
+ types:
+ # Structure:
+ # swaggerType: <targetTypeSpec>
+ # OR
+ # swaggerType:
+ # - swaggerFormat: <targetTypeSpec>
+ # - /swaggerFormatRegEx/: <targetTypeSpec>
+ # - //: <targetTypeSpec> # default, if the format doesn't mach anything above
+ # WHERE
+ # targetTypeSpec = targetType OR
+ # { type: targetType, imports: <filename OR [ filenames... ]>, <other attributes...> }
+ integer:
+ - int64: qint64
+ - int32: qint32
+ - //: int
+ number:
+ - float: float
+ - //: double
+ boolean: { type: bool, initializer: false }
+ string:
+ - byte: &ByteStream
+ type: QIODevice*
+ #initializer: '"{{defaultValue}}"'
+ #string?: true
+ imports: <QtCore/QIODevice>
+ - binary: *ByteStream
+ - date:
+ type: QDate
+ initializer: QDate::fromString("{{defaultValue}}")
+ avoidCopy?: true
+ imports: <QtCore/QDate>
+ - dateTime:
+ type: QDateTime
+ initializer: QDateTime::fromString("{{defaultValue}}")
+ avoidCopy?: true
+ imports: <QtCore/QDateTime>
+ - //:
+ type: QString
+ initializer: QStringLiteral("{{defaultValue}}")
+ string?: true
+ avoidCopy?: true
+ file: *ByteStream
+ object:
+ - /m\.room\.member$/: # A stub for EventsBatch<RoomMemberEvent>
+ - /state_event.yaml$/:
+ type: StateEventPtr
+ noCopy?: true
+ imports: '"events/event.h"'
+ - /room_event.yaml$/:
+ type: RoomEventPtr
+ noCopy?: true
+ imports: '"events/event.h"'
+ - /event.yaml$/:
+ type: EventPtr
+ noCopy?: true
+ imports: '"events/event.h"'
+ - //:
+ type: QJsonObject
+ avoidCopy?: true
+ imports: <QtCore/QJsonObject>
+ array:
+ - string:
+ type: QStringList
+ avoidCopy?: true
+ imports: <QtCore/QStringList>
+ - /^Notification|Result$/:
+ type: "std::vector<{{1}}>"
+ noCopy?: true
+ imports: '"events/event.h"'
+ - /m\.room\.member$/:
+ type: "EventsArray<RoomMemberEvent>"
+ noCopy?: true
+ imports: '"events/roommemberevent.h"'
+ - /state_event.yaml$/:
+ type: StateEvents
+ noCopy?: true
+ - /room_event.yaml$/:
+ type: RoomEvents
+ noCopy?: true
+ - /event.yaml$/:
+ type: Events
+ noCopy?: true
+ - /.+/:
+ type: "QVector<{{1}}>"
+ avoidCopy?: true
+ imports: <QtCore/QVector>
+ - //: { type: QJsonArray, "avoidCopy?": true, imports: <QtCore/QJsonArray> }
+ map:
+ - RoomState:
+ type: "std::unordered_map<QString, {{1}}>"
+ noCopy?: true
+ imports: <unordered_map>
+ - /.+/:
+ type: "QHash<QString, {{1}}>"
+ avoidCopy?: true
+ imports: <QtCore/QHash>
+ - //:
+ type: QVariantHash
+ avoidCopy?: true
+ imports: <QtCore/QVariantHash>
+ variant: { type: QVariant, "avoidCopy?": true, imports: <QtCore/QVariant> }
+ schema: # Properties of inline structure definitions
+ avoidCopy?: true
+
+ #operations:
+
+mustache:
+ definitions:
+ _scopeRenderer: "{{scopeCamelCase}}Job::"
+ _literalQuote: '"'
+ maybeCrefType: "{{#avoidCopy?}}const {{/avoidCopy?}}{{dataType.name}}{{#avoidCopy?}}&{{/avoidCopy?}}{{#noCopy?}}&&{{/noCopy?}}"
+ qualifiedMaybeCrefType:
+ "{{#avoidCopy?}}const {{/avoidCopy?}}{{dataType.qualifiedName}}{{#avoidCopy?}}&{{/avoidCopy?}}{{#noCopy?}}&&{{/noCopy?}}"
+ initializeDefaultValue: "{{#defaultValue}}{{>initializer}}{{/defaultValue}}{{^defaultValue}}{}{{/defaultValue}}"
+ joinedParamDecl: '{{>maybeCrefType}} {{paramName}}{{^required?}} = {{>initializeDefaultValue}}{{/required?}}{{#@join}}, {{/@join}}'
+ joinedParamDef: '{{>maybeCrefType}} {{paramName}}{{#@join}}, {{/@join}}'
+ passQueryParams: '{{#queryParams}}{{paramName}}{{#@join}}, {{/@join}}{{/queryParams}}'
+ paramToString: '{{#string?}}{{nameCamelCase}}{{/string?}}{{^string?}}QString("%1").arg({{nameCamelCase}}){{/string?}}'
+ # preamble: preamble.mustache
+ copyrightName: Kitsune Ral
+ copyrightEmail: <kitsune-ral@users.sf.net>
+
+ templates:
+ - "{{base}}.h.mustache"
+ - "{{base}}.cpp.mustache"
+
+ #outFilesList: apifiles.txt
+
diff --git a/lib/csapi/inviting.cpp b/lib/csapi/inviting.cpp
new file mode 100644
index 00000000..d2ee2107
--- /dev/null
+++ b/lib/csapi/inviting.cpp
@@ -0,0 +1,23 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "inviting.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+InviteUserJob::InviteUserJob(const QString& roomId, const QString& userId)
+ : BaseJob(HttpVerb::Post, "InviteUserJob",
+ basePath % "/rooms/" % roomId % "/invite")
+{
+ QJsonObject _data;
+ _data.insert("user_id", toJson(userId));
+ setRequestData(_data);
+}
+
diff --git a/lib/csapi/inviting.h b/lib/csapi/inviting.h
new file mode 100644
index 00000000..3119de6a
--- /dev/null
+++ b/lib/csapi/inviting.h
@@ -0,0 +1,20 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class InviteUserJob : public BaseJob
+ {
+ public:
+ explicit InviteUserJob(const QString& roomId, const QString& userId);
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/joining.cpp b/lib/csapi/joining.cpp
new file mode 100644
index 00000000..705e8f83
--- /dev/null
+++ b/lib/csapi/joining.cpp
@@ -0,0 +1,118 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "joining.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+namespace QMatrixClient
+{
+ // Converters
+
+ QJsonObject toJson(const JoinRoomByIdJob::ThirdPartySigned& pod)
+ {
+ QJsonObject o;
+ o.insert("sender", toJson(pod.sender));
+ o.insert("mxid", toJson(pod.mxid));
+ o.insert("token", toJson(pod.token));
+ o.insert("signatures", toJson(pod.signatures));
+
+ return o;
+ }
+} // namespace QMatrixClient
+
+class JoinRoomByIdJob::Private
+{
+ public:
+ QString roomId;
+};
+
+JoinRoomByIdJob::JoinRoomByIdJob(const QString& roomId, const ThirdPartySigned& thirdPartySigned)
+ : BaseJob(HttpVerb::Post, "JoinRoomByIdJob",
+ basePath % "/rooms/" % roomId % "/join")
+ , d(new Private)
+{
+ QJsonObject _data;
+ _data.insert("third_party_signed", toJson(thirdPartySigned));
+ setRequestData(_data);
+}
+
+JoinRoomByIdJob::~JoinRoomByIdJob() = default;
+
+const QString& JoinRoomByIdJob::roomId() const
+{
+ return d->roomId;
+}
+
+BaseJob::Status JoinRoomByIdJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ if (!json.contains("room_id"))
+ return { JsonParseError,
+ "The key 'room_id' not found in the response" };
+ d->roomId = fromJson<QString>(json.value("room_id"));
+ return Success;
+}
+
+namespace QMatrixClient
+{
+ // Converters
+
+ QJsonObject toJson(const JoinRoomJob::Signed& pod)
+ {
+ QJsonObject o;
+ o.insert("sender", toJson(pod.sender));
+ o.insert("mxid", toJson(pod.mxid));
+ o.insert("token", toJson(pod.token));
+ o.insert("signatures", toJson(pod.signatures));
+
+ return o;
+ }
+
+ QJsonObject toJson(const JoinRoomJob::ThirdPartySigned& pod)
+ {
+ QJsonObject o;
+ o.insert("signed", toJson(pod.signedData));
+
+ return o;
+ }
+} // namespace QMatrixClient
+
+class JoinRoomJob::Private
+{
+ public:
+ QString roomId;
+};
+
+JoinRoomJob::JoinRoomJob(const QString& roomIdOrAlias, const ThirdPartySigned& thirdPartySigned)
+ : BaseJob(HttpVerb::Post, "JoinRoomJob",
+ basePath % "/join/" % roomIdOrAlias)
+ , d(new Private)
+{
+ QJsonObject _data;
+ _data.insert("third_party_signed", toJson(thirdPartySigned));
+ setRequestData(_data);
+}
+
+JoinRoomJob::~JoinRoomJob() = default;
+
+const QString& JoinRoomJob::roomId() const
+{
+ return d->roomId;
+}
+
+BaseJob::Status JoinRoomJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ if (!json.contains("room_id"))
+ return { JsonParseError,
+ "The key 'room_id' not found in the response" };
+ d->roomId = fromJson<QString>(json.value("room_id"));
+ return Success;
+}
+
diff --git a/lib/csapi/joining.h b/lib/csapi/joining.h
new file mode 100644
index 00000000..ccaed04e
--- /dev/null
+++ b/lib/csapi/joining.h
@@ -0,0 +1,81 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include <QtCore/QJsonObject>
+
+#include "converters.h"
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class JoinRoomByIdJob : public BaseJob
+ {
+ public:
+ // Inner data structures
+
+ struct ThirdPartySigned
+ {
+ QString sender;
+ QString mxid;
+ QString token;
+ QJsonObject signatures;
+ };
+
+ // Construction/destruction
+
+ explicit JoinRoomByIdJob(const QString& roomId, const ThirdPartySigned& thirdPartySigned = {});
+ ~JoinRoomByIdJob() override;
+
+ // Result properties
+
+ const QString& roomId() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+
+ class JoinRoomJob : public BaseJob
+ {
+ public:
+ // Inner data structures
+
+ struct Signed
+ {
+ QString sender;
+ QString mxid;
+ QString token;
+ QJsonObject signatures;
+ };
+
+ struct ThirdPartySigned
+ {
+ Signed signedData;
+ };
+
+ // Construction/destruction
+
+ explicit JoinRoomJob(const QString& roomIdOrAlias, const ThirdPartySigned& thirdPartySigned = {});
+ ~JoinRoomJob() override;
+
+ // Result properties
+
+ const QString& roomId() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/kicking.cpp b/lib/csapi/kicking.cpp
new file mode 100644
index 00000000..bf2490b7
--- /dev/null
+++ b/lib/csapi/kicking.cpp
@@ -0,0 +1,25 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "kicking.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+KickJob::KickJob(const QString& roomId, const QString& userId, const QString& reason)
+ : BaseJob(HttpVerb::Post, "KickJob",
+ basePath % "/rooms/" % roomId % "/kick")
+{
+ QJsonObject _data;
+ _data.insert("user_id", toJson(userId));
+ if (!reason.isEmpty())
+ _data.insert("reason", toJson(reason));
+ setRequestData(_data);
+}
+
diff --git a/lib/csapi/kicking.h b/lib/csapi/kicking.h
new file mode 100644
index 00000000..030dff88
--- /dev/null
+++ b/lib/csapi/kicking.h
@@ -0,0 +1,20 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class KickJob : public BaseJob
+ {
+ public:
+ explicit KickJob(const QString& roomId, const QString& userId, const QString& reason = {});
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/leaving.cpp b/lib/csapi/leaving.cpp
new file mode 100644
index 00000000..afc4adbd
--- /dev/null
+++ b/lib/csapi/leaving.cpp
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "leaving.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+QUrl LeaveRoomJob::makeRequestUrl(QUrl baseUrl, const QString& roomId)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/rooms/" % roomId % "/leave");
+}
+
+LeaveRoomJob::LeaveRoomJob(const QString& roomId)
+ : BaseJob(HttpVerb::Post, "LeaveRoomJob",
+ basePath % "/rooms/" % roomId % "/leave")
+{
+}
+
+QUrl ForgetRoomJob::makeRequestUrl(QUrl baseUrl, const QString& roomId)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/rooms/" % roomId % "/forget");
+}
+
+ForgetRoomJob::ForgetRoomJob(const QString& roomId)
+ : BaseJob(HttpVerb::Post, "ForgetRoomJob",
+ basePath % "/rooms/" % roomId % "/forget")
+{
+}
+
diff --git a/lib/csapi/leaving.h b/lib/csapi/leaving.h
new file mode 100644
index 00000000..f6711c32
--- /dev/null
+++ b/lib/csapi/leaving.h
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class LeaveRoomJob : public BaseJob
+ {
+ public:
+ explicit LeaveRoomJob(const QString& roomId);
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * LeaveRoomJob. This function can be used when
+ * a URL for LeaveRoomJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& roomId);
+
+ };
+
+ class ForgetRoomJob : public BaseJob
+ {
+ public:
+ explicit ForgetRoomJob(const QString& roomId);
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * ForgetRoomJob. This function can be used when
+ * a URL for ForgetRoomJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& roomId);
+
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/list_joined_rooms.cpp b/lib/csapi/list_joined_rooms.cpp
new file mode 100644
index 00000000..82ec8849
--- /dev/null
+++ b/lib/csapi/list_joined_rooms.cpp
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "list_joined_rooms.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+class GetJoinedRoomsJob::Private
+{
+ public:
+ QStringList joinedRooms;
+};
+
+QUrl GetJoinedRoomsJob::makeRequestUrl(QUrl baseUrl)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/joined_rooms");
+}
+
+GetJoinedRoomsJob::GetJoinedRoomsJob()
+ : BaseJob(HttpVerb::Get, "GetJoinedRoomsJob",
+ basePath % "/joined_rooms")
+ , d(new Private)
+{
+}
+
+GetJoinedRoomsJob::~GetJoinedRoomsJob() = default;
+
+const QStringList& GetJoinedRoomsJob::joinedRooms() const
+{
+ return d->joinedRooms;
+}
+
+BaseJob::Status GetJoinedRoomsJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ if (!json.contains("joined_rooms"))
+ return { JsonParseError,
+ "The key 'joined_rooms' not found in the response" };
+ d->joinedRooms = fromJson<QStringList>(json.value("joined_rooms"));
+ return Success;
+}
+
diff --git a/lib/csapi/list_joined_rooms.h b/lib/csapi/list_joined_rooms.h
new file mode 100644
index 00000000..e590fa18
--- /dev/null
+++ b/lib/csapi/list_joined_rooms.h
@@ -0,0 +1,41 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include <QtCore/QStringList>
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class GetJoinedRoomsJob : public BaseJob
+ {
+ public:
+ explicit GetJoinedRoomsJob();
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetJoinedRoomsJob. This function can be used when
+ * a URL for GetJoinedRoomsJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl);
+
+ ~GetJoinedRoomsJob() override;
+
+ // Result properties
+
+ const QStringList& joinedRooms() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/list_public_rooms.cpp b/lib/csapi/list_public_rooms.cpp
new file mode 100644
index 00000000..b27bdd58
--- /dev/null
+++ b/lib/csapi/list_public_rooms.cpp
@@ -0,0 +1,268 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "list_public_rooms.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+class GetRoomVisibilityOnDirectoryJob::Private
+{
+ public:
+ QString visibility;
+};
+
+QUrl GetRoomVisibilityOnDirectoryJob::makeRequestUrl(QUrl baseUrl, const QString& roomId)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/directory/list/room/" % roomId);
+}
+
+GetRoomVisibilityOnDirectoryJob::GetRoomVisibilityOnDirectoryJob(const QString& roomId)
+ : BaseJob(HttpVerb::Get, "GetRoomVisibilityOnDirectoryJob",
+ basePath % "/directory/list/room/" % roomId, false)
+ , d(new Private)
+{
+}
+
+GetRoomVisibilityOnDirectoryJob::~GetRoomVisibilityOnDirectoryJob() = default;
+
+const QString& GetRoomVisibilityOnDirectoryJob::visibility() const
+{
+ return d->visibility;
+}
+
+BaseJob::Status GetRoomVisibilityOnDirectoryJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ d->visibility = fromJson<QString>(json.value("visibility"));
+ return Success;
+}
+
+SetRoomVisibilityOnDirectoryJob::SetRoomVisibilityOnDirectoryJob(const QString& roomId, const QString& visibility)
+ : BaseJob(HttpVerb::Put, "SetRoomVisibilityOnDirectoryJob",
+ basePath % "/directory/list/room/" % roomId)
+{
+ QJsonObject _data;
+ if (!visibility.isEmpty())
+ _data.insert("visibility", toJson(visibility));
+ setRequestData(_data);
+}
+
+namespace QMatrixClient
+{
+ // Converters
+
+ template <> struct FromJson<GetPublicRoomsJob::PublicRoomsChunk>
+ {
+ GetPublicRoomsJob::PublicRoomsChunk operator()(const QJsonValue& jv)
+ {
+ const auto& o = jv.toObject();
+ GetPublicRoomsJob::PublicRoomsChunk result;
+ result.aliases =
+ fromJson<QStringList>(o.value("aliases"));
+ result.canonicalAlias =
+ fromJson<QString>(o.value("canonical_alias"));
+ result.name =
+ fromJson<QString>(o.value("name"));
+ result.numJoinedMembers =
+ fromJson<qint64>(o.value("num_joined_members"));
+ result.roomId =
+ fromJson<QString>(o.value("room_id"));
+ result.topic =
+ fromJson<QString>(o.value("topic"));
+ result.worldReadable =
+ fromJson<bool>(o.value("world_readable"));
+ result.guestCanJoin =
+ fromJson<bool>(o.value("guest_can_join"));
+ result.avatarUrl =
+ fromJson<QString>(o.value("avatar_url"));
+
+ return result;
+ }
+ };
+} // namespace QMatrixClient
+
+class GetPublicRoomsJob::Private
+{
+ public:
+ QVector<PublicRoomsChunk> chunk;
+ QString nextBatch;
+ QString prevBatch;
+ qint64 totalRoomCountEstimate;
+};
+
+BaseJob::Query queryToGetPublicRooms(int limit, const QString& since, const QString& server)
+{
+ BaseJob::Query _q;
+ _q.addQueryItem("limit", QString("%1").arg(limit));
+ if (!since.isEmpty())
+ _q.addQueryItem("since", since);
+ if (!server.isEmpty())
+ _q.addQueryItem("server", server);
+ return _q;
+}
+
+QUrl GetPublicRoomsJob::makeRequestUrl(QUrl baseUrl, int limit, const QString& since, const QString& server)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/publicRooms",
+ queryToGetPublicRooms(limit, since, server));
+}
+
+GetPublicRoomsJob::GetPublicRoomsJob(int limit, const QString& since, const QString& server)
+ : BaseJob(HttpVerb::Get, "GetPublicRoomsJob",
+ basePath % "/publicRooms",
+ queryToGetPublicRooms(limit, since, server),
+ {}, false)
+ , d(new Private)
+{
+}
+
+GetPublicRoomsJob::~GetPublicRoomsJob() = default;
+
+const QVector<GetPublicRoomsJob::PublicRoomsChunk>& GetPublicRoomsJob::chunk() const
+{
+ return d->chunk;
+}
+
+const QString& GetPublicRoomsJob::nextBatch() const
+{
+ return d->nextBatch;
+}
+
+const QString& GetPublicRoomsJob::prevBatch() const
+{
+ return d->prevBatch;
+}
+
+qint64 GetPublicRoomsJob::totalRoomCountEstimate() const
+{
+ return d->totalRoomCountEstimate;
+}
+
+BaseJob::Status GetPublicRoomsJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ if (!json.contains("chunk"))
+ return { JsonParseError,
+ "The key 'chunk' not found in the response" };
+ d->chunk = fromJson<QVector<PublicRoomsChunk>>(json.value("chunk"));
+ d->nextBatch = fromJson<QString>(json.value("next_batch"));
+ d->prevBatch = fromJson<QString>(json.value("prev_batch"));
+ d->totalRoomCountEstimate = fromJson<qint64>(json.value("total_room_count_estimate"));
+ return Success;
+}
+
+namespace QMatrixClient
+{
+ // Converters
+
+ QJsonObject toJson(const QueryPublicRoomsJob::Filter& pod)
+ {
+ QJsonObject o;
+ o.insert("generic_search_term", toJson(pod.genericSearchTerm));
+
+ return o;
+ }
+
+ template <> struct FromJson<QueryPublicRoomsJob::PublicRoomsChunk>
+ {
+ QueryPublicRoomsJob::PublicRoomsChunk operator()(const QJsonValue& jv)
+ {
+ const auto& o = jv.toObject();
+ QueryPublicRoomsJob::PublicRoomsChunk result;
+ result.aliases =
+ fromJson<QStringList>(o.value("aliases"));
+ result.canonicalAlias =
+ fromJson<QString>(o.value("canonical_alias"));
+ result.name =
+ fromJson<QString>(o.value("name"));
+ result.numJoinedMembers =
+ fromJson<qint64>(o.value("num_joined_members"));
+ result.roomId =
+ fromJson<QString>(o.value("room_id"));
+ result.topic =
+ fromJson<QString>(o.value("topic"));
+ result.worldReadable =
+ fromJson<bool>(o.value("world_readable"));
+ result.guestCanJoin =
+ fromJson<bool>(o.value("guest_can_join"));
+ result.avatarUrl =
+ fromJson<QString>(o.value("avatar_url"));
+
+ return result;
+ }
+ };
+} // namespace QMatrixClient
+
+class QueryPublicRoomsJob::Private
+{
+ public:
+ QVector<PublicRoomsChunk> chunk;
+ QString nextBatch;
+ QString prevBatch;
+ qint64 totalRoomCountEstimate;
+};
+
+BaseJob::Query queryToQueryPublicRooms(const QString& server)
+{
+ BaseJob::Query _q;
+ if (!server.isEmpty())
+ _q.addQueryItem("server", server);
+ return _q;
+}
+
+QueryPublicRoomsJob::QueryPublicRoomsJob(const QString& server, int limit, const QString& since, const Filter& filter)
+ : BaseJob(HttpVerb::Post, "QueryPublicRoomsJob",
+ basePath % "/publicRooms",
+ queryToQueryPublicRooms(server))
+ , d(new Private)
+{
+ QJsonObject _data;
+ _data.insert("limit", toJson(limit));
+ if (!since.isEmpty())
+ _data.insert("since", toJson(since));
+ _data.insert("filter", toJson(filter));
+ setRequestData(_data);
+}
+
+QueryPublicRoomsJob::~QueryPublicRoomsJob() = default;
+
+const QVector<QueryPublicRoomsJob::PublicRoomsChunk>& QueryPublicRoomsJob::chunk() const
+{
+ return d->chunk;
+}
+
+const QString& QueryPublicRoomsJob::nextBatch() const
+{
+ return d->nextBatch;
+}
+
+const QString& QueryPublicRoomsJob::prevBatch() const
+{
+ return d->prevBatch;
+}
+
+qint64 QueryPublicRoomsJob::totalRoomCountEstimate() const
+{
+ return d->totalRoomCountEstimate;
+}
+
+BaseJob::Status QueryPublicRoomsJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ if (!json.contains("chunk"))
+ return { JsonParseError,
+ "The key 'chunk' not found in the response" };
+ d->chunk = fromJson<QVector<PublicRoomsChunk>>(json.value("chunk"));
+ d->nextBatch = fromJson<QString>(json.value("next_batch"));
+ d->prevBatch = fromJson<QString>(json.value("prev_batch"));
+ d->totalRoomCountEstimate = fromJson<qint64>(json.value("total_room_count_estimate"));
+ return Success;
+}
+
diff --git a/lib/csapi/list_public_rooms.h b/lib/csapi/list_public_rooms.h
new file mode 100644
index 00000000..76d78577
--- /dev/null
+++ b/lib/csapi/list_public_rooms.h
@@ -0,0 +1,138 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include <QtCore/QVector>
+#include <QtCore/QStringList>
+
+#include "converters.h"
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class GetRoomVisibilityOnDirectoryJob : public BaseJob
+ {
+ public:
+ explicit GetRoomVisibilityOnDirectoryJob(const QString& roomId);
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetRoomVisibilityOnDirectoryJob. This function can be used when
+ * a URL for GetRoomVisibilityOnDirectoryJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& roomId);
+
+ ~GetRoomVisibilityOnDirectoryJob() override;
+
+ // Result properties
+
+ const QString& visibility() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+
+ class SetRoomVisibilityOnDirectoryJob : public BaseJob
+ {
+ public:
+ explicit SetRoomVisibilityOnDirectoryJob(const QString& roomId, const QString& visibility = {});
+ };
+
+ class GetPublicRoomsJob : public BaseJob
+ {
+ public:
+ // Inner data structures
+
+ struct PublicRoomsChunk
+ {
+ QStringList aliases;
+ QString canonicalAlias;
+ QString name;
+ qint64 numJoinedMembers;
+ QString roomId;
+ QString topic;
+ bool worldReadable;
+ bool guestCanJoin;
+ QString avatarUrl;
+ };
+
+ // Construction/destruction
+
+ explicit GetPublicRoomsJob(int limit = {}, const QString& since = {}, const QString& server = {});
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetPublicRoomsJob. This function can be used when
+ * a URL for GetPublicRoomsJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, int limit = {}, const QString& since = {}, const QString& server = {});
+
+ ~GetPublicRoomsJob() override;
+
+ // Result properties
+
+ const QVector<PublicRoomsChunk>& chunk() const;
+ const QString& nextBatch() const;
+ const QString& prevBatch() const;
+ qint64 totalRoomCountEstimate() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+
+ class QueryPublicRoomsJob : public BaseJob
+ {
+ public:
+ // Inner data structures
+
+ struct Filter
+ {
+ QString genericSearchTerm;
+ };
+
+ struct PublicRoomsChunk
+ {
+ QStringList aliases;
+ QString canonicalAlias;
+ QString name;
+ qint64 numJoinedMembers;
+ QString roomId;
+ QString topic;
+ bool worldReadable;
+ bool guestCanJoin;
+ QString avatarUrl;
+ };
+
+ // Construction/destruction
+
+ explicit QueryPublicRoomsJob(const QString& server = {}, int limit = {}, const QString& since = {}, const Filter& filter = {});
+ ~QueryPublicRoomsJob() override;
+
+ // Result properties
+
+ const QVector<PublicRoomsChunk>& chunk() const;
+ const QString& nextBatch() const;
+ const QString& prevBatch() const;
+ qint64 totalRoomCountEstimate() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/login.cpp b/lib/csapi/login.cpp
new file mode 100644
index 00000000..a4dab428
--- /dev/null
+++ b/lib/csapi/login.cpp
@@ -0,0 +1,79 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "login.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+class LoginJob::Private
+{
+ public:
+ QString userId;
+ QString accessToken;
+ QString homeServer;
+ QString deviceId;
+};
+
+LoginJob::LoginJob(const QString& type, const QString& user, const QString& medium, const QString& address, const QString& password, const QString& token, const QString& deviceId, const QString& initialDeviceDisplayName)
+ : BaseJob(HttpVerb::Post, "LoginJob",
+ basePath % "/login", false)
+ , d(new Private)
+{
+ QJsonObject _data;
+ _data.insert("type", toJson(type));
+ if (!user.isEmpty())
+ _data.insert("user", toJson(user));
+ if (!medium.isEmpty())
+ _data.insert("medium", toJson(medium));
+ if (!address.isEmpty())
+ _data.insert("address", toJson(address));
+ if (!password.isEmpty())
+ _data.insert("password", toJson(password));
+ if (!token.isEmpty())
+ _data.insert("token", toJson(token));
+ if (!deviceId.isEmpty())
+ _data.insert("device_id", toJson(deviceId));
+ if (!initialDeviceDisplayName.isEmpty())
+ _data.insert("initial_device_display_name", toJson(initialDeviceDisplayName));
+ setRequestData(_data);
+}
+
+LoginJob::~LoginJob() = default;
+
+const QString& LoginJob::userId() const
+{
+ return d->userId;
+}
+
+const QString& LoginJob::accessToken() const
+{
+ return d->accessToken;
+}
+
+const QString& LoginJob::homeServer() const
+{
+ return d->homeServer;
+}
+
+const QString& LoginJob::deviceId() const
+{
+ return d->deviceId;
+}
+
+BaseJob::Status LoginJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ d->userId = fromJson<QString>(json.value("user_id"));
+ d->accessToken = fromJson<QString>(json.value("access_token"));
+ d->homeServer = fromJson<QString>(json.value("home_server"));
+ d->deviceId = fromJson<QString>(json.value("device_id"));
+ return Success;
+}
+
diff --git a/lib/csapi/login.h b/lib/csapi/login.h
new file mode 100644
index 00000000..2adbdb4d
--- /dev/null
+++ b/lib/csapi/login.h
@@ -0,0 +1,35 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class LoginJob : public BaseJob
+ {
+ public:
+ explicit LoginJob(const QString& type, const QString& user = {}, const QString& medium = {}, const QString& address = {}, const QString& password = {}, const QString& token = {}, const QString& deviceId = {}, const QString& initialDeviceDisplayName = {});
+ ~LoginJob() override;
+
+ // Result properties
+
+ const QString& userId() const;
+ const QString& accessToken() const;
+ const QString& homeServer() const;
+ const QString& deviceId() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/logout.cpp b/lib/csapi/logout.cpp
new file mode 100644
index 00000000..b943dcd3
--- /dev/null
+++ b/lib/csapi/logout.cpp
@@ -0,0 +1,26 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "logout.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+QUrl LogoutJob::makeRequestUrl(QUrl baseUrl)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/logout");
+}
+
+LogoutJob::LogoutJob()
+ : BaseJob(HttpVerb::Post, "LogoutJob",
+ basePath % "/logout")
+{
+}
+
diff --git a/lib/csapi/logout.h b/lib/csapi/logout.h
new file mode 100644
index 00000000..7993335f
--- /dev/null
+++ b/lib/csapi/logout.h
@@ -0,0 +1,28 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class LogoutJob : public BaseJob
+ {
+ public:
+ explicit LogoutJob();
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * LogoutJob. This function can be used when
+ * a URL for LogoutJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl);
+
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/message_pagination.cpp b/lib/csapi/message_pagination.cpp
new file mode 100644
index 00000000..f89ccd03
--- /dev/null
+++ b/lib/csapi/message_pagination.cpp
@@ -0,0 +1,76 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "message_pagination.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+class GetRoomEventsJob::Private
+{
+ public:
+ QString begin;
+ QString end;
+ RoomEvents chunk;
+};
+
+BaseJob::Query queryToGetRoomEvents(const QString& from, const QString& to, const QString& dir, int limit, const QString& filter)
+{
+ BaseJob::Query _q;
+ _q.addQueryItem("from", from);
+ if (!to.isEmpty())
+ _q.addQueryItem("to", to);
+ _q.addQueryItem("dir", dir);
+ _q.addQueryItem("limit", QString("%1").arg(limit));
+ if (!filter.isEmpty())
+ _q.addQueryItem("filter", filter);
+ return _q;
+}
+
+QUrl GetRoomEventsJob::makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& from, const QString& dir, const QString& to, int limit, const QString& filter)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/rooms/" % roomId % "/messages",
+ queryToGetRoomEvents(from, to, dir, limit, filter));
+}
+
+GetRoomEventsJob::GetRoomEventsJob(const QString& roomId, const QString& from, const QString& dir, const QString& to, int limit, const QString& filter)
+ : BaseJob(HttpVerb::Get, "GetRoomEventsJob",
+ basePath % "/rooms/" % roomId % "/messages",
+ queryToGetRoomEvents(from, to, dir, limit, filter))
+ , d(new Private)
+{
+}
+
+GetRoomEventsJob::~GetRoomEventsJob() = default;
+
+const QString& GetRoomEventsJob::begin() const
+{
+ return d->begin;
+}
+
+const QString& GetRoomEventsJob::end() const
+{
+ return d->end;
+}
+
+RoomEvents&& GetRoomEventsJob::chunk()
+{
+ return std::move(d->chunk);
+}
+
+BaseJob::Status GetRoomEventsJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ d->begin = fromJson<QString>(json.value("start"));
+ d->end = fromJson<QString>(json.value("end"));
+ d->chunk = fromJson<RoomEvents>(json.value("chunk"));
+ return Success;
+}
+
diff --git a/lib/csapi/message_pagination.h b/lib/csapi/message_pagination.h
new file mode 100644
index 00000000..61e7323f
--- /dev/null
+++ b/lib/csapi/message_pagination.h
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include "events/event.h"
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class GetRoomEventsJob : public BaseJob
+ {
+ public:
+ explicit GetRoomEventsJob(const QString& roomId, const QString& from, const QString& dir, const QString& to = {}, int limit = {}, const QString& filter = {});
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetRoomEventsJob. This function can be used when
+ * a URL for GetRoomEventsJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& from, const QString& dir, const QString& to = {}, int limit = {}, const QString& filter = {});
+
+ ~GetRoomEventsJob() override;
+
+ // Result properties
+
+ const QString& begin() const;
+ const QString& end() const;
+ RoomEvents&& chunk();
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/notifications.cpp b/lib/csapi/notifications.cpp
new file mode 100644
index 00000000..04ad0175
--- /dev/null
+++ b/lib/csapi/notifications.cpp
@@ -0,0 +1,96 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "notifications.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+namespace QMatrixClient
+{
+ // Converters
+
+ template <> struct FromJson<GetNotificationsJob::Notification>
+ {
+ GetNotificationsJob::Notification operator()(const QJsonValue& jv)
+ {
+ const auto& o = jv.toObject();
+ GetNotificationsJob::Notification result;
+ result.actions =
+ fromJson<QVector<QJsonObject>>(o.value("actions"));
+ result.event =
+ fromJson<EventPtr>(o.value("event"));
+ result.profileTag =
+ fromJson<QString>(o.value("profile_tag"));
+ result.read =
+ fromJson<bool>(o.value("read"));
+ result.roomId =
+ fromJson<QString>(o.value("room_id"));
+ result.ts =
+ fromJson<qint64>(o.value("ts"));
+
+ return result;
+ }
+ };
+} // namespace QMatrixClient
+
+class GetNotificationsJob::Private
+{
+ public:
+ QString nextToken;
+ std::vector<Notification> notifications;
+};
+
+BaseJob::Query queryToGetNotifications(const QString& from, int limit, const QString& only)
+{
+ BaseJob::Query _q;
+ if (!from.isEmpty())
+ _q.addQueryItem("from", from);
+ _q.addQueryItem("limit", QString("%1").arg(limit));
+ if (!only.isEmpty())
+ _q.addQueryItem("only", only);
+ return _q;
+}
+
+QUrl GetNotificationsJob::makeRequestUrl(QUrl baseUrl, const QString& from, int limit, const QString& only)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/notifications",
+ queryToGetNotifications(from, limit, only));
+}
+
+GetNotificationsJob::GetNotificationsJob(const QString& from, int limit, const QString& only)
+ : BaseJob(HttpVerb::Get, "GetNotificationsJob",
+ basePath % "/notifications",
+ queryToGetNotifications(from, limit, only))
+ , d(new Private)
+{
+}
+
+GetNotificationsJob::~GetNotificationsJob() = default;
+
+const QString& GetNotificationsJob::nextToken() const
+{
+ return d->nextToken;
+}
+
+std::vector<GetNotificationsJob::Notification>&& GetNotificationsJob::notifications()
+{
+ return std::move(d->notifications);
+}
+
+BaseJob::Status GetNotificationsJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ d->nextToken = fromJson<QString>(json.value("next_token"));
+ if (!json.contains("notifications"))
+ return { JsonParseError,
+ "The key 'notifications' not found in the response" };
+ d->notifications = fromJson<std::vector<Notification>>(json.value("notifications"));
+ return Success;
+}
+
diff --git a/lib/csapi/notifications.h b/lib/csapi/notifications.h
new file mode 100644
index 00000000..61da518b
--- /dev/null
+++ b/lib/csapi/notifications.h
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include "events/event.h"
+#include <QtCore/QJsonObject>
+#include <QtCore/QVector>
+
+#include "converters.h"
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class GetNotificationsJob : public BaseJob
+ {
+ public:
+ // Inner data structures
+
+ struct Notification
+ {
+ QVector<QJsonObject> actions;
+ EventPtr event;
+ QString profileTag;
+ bool read;
+ QString roomId;
+ qint64 ts;
+ };
+
+ // Construction/destruction
+
+ explicit GetNotificationsJob(const QString& from = {}, int limit = {}, const QString& only = {});
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetNotificationsJob. This function can be used when
+ * a URL for GetNotificationsJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& from = {}, int limit = {}, const QString& only = {});
+
+ ~GetNotificationsJob() override;
+
+ // Result properties
+
+ const QString& nextToken() const;
+ std::vector<Notification>&& notifications();
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/preamble.mustache b/lib/csapi/preamble.mustache
new file mode 100644
index 00000000..3ba87d61
--- /dev/null
+++ b/lib/csapi/preamble.mustache
@@ -0,0 +1,3 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
diff --git a/lib/csapi/profile.cpp b/lib/csapi/profile.cpp
new file mode 100644
index 00000000..d8ddbc14
--- /dev/null
+++ b/lib/csapi/profile.cpp
@@ -0,0 +1,140 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "profile.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+SetDisplayNameJob::SetDisplayNameJob(const QString& userId, const QString& displayname)
+ : BaseJob(HttpVerb::Put, "SetDisplayNameJob",
+ basePath % "/profile/" % userId % "/displayname")
+{
+ QJsonObject _data;
+ if (!displayname.isEmpty())
+ _data.insert("displayname", toJson(displayname));
+ setRequestData(_data);
+}
+
+class GetDisplayNameJob::Private
+{
+ public:
+ QString displayname;
+};
+
+QUrl GetDisplayNameJob::makeRequestUrl(QUrl baseUrl, const QString& userId)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/profile/" % userId % "/displayname");
+}
+
+GetDisplayNameJob::GetDisplayNameJob(const QString& userId)
+ : BaseJob(HttpVerb::Get, "GetDisplayNameJob",
+ basePath % "/profile/" % userId % "/displayname", false)
+ , d(new Private)
+{
+}
+
+GetDisplayNameJob::~GetDisplayNameJob() = default;
+
+const QString& GetDisplayNameJob::displayname() const
+{
+ return d->displayname;
+}
+
+BaseJob::Status GetDisplayNameJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ d->displayname = fromJson<QString>(json.value("displayname"));
+ return Success;
+}
+
+SetAvatarUrlJob::SetAvatarUrlJob(const QString& userId, const QString& avatarUrl)
+ : BaseJob(HttpVerb::Put, "SetAvatarUrlJob",
+ basePath % "/profile/" % userId % "/avatar_url")
+{
+ QJsonObject _data;
+ if (!avatarUrl.isEmpty())
+ _data.insert("avatar_url", toJson(avatarUrl));
+ setRequestData(_data);
+}
+
+class GetAvatarUrlJob::Private
+{
+ public:
+ QString avatarUrl;
+};
+
+QUrl GetAvatarUrlJob::makeRequestUrl(QUrl baseUrl, const QString& userId)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/profile/" % userId % "/avatar_url");
+}
+
+GetAvatarUrlJob::GetAvatarUrlJob(const QString& userId)
+ : BaseJob(HttpVerb::Get, "GetAvatarUrlJob",
+ basePath % "/profile/" % userId % "/avatar_url", false)
+ , d(new Private)
+{
+}
+
+GetAvatarUrlJob::~GetAvatarUrlJob() = default;
+
+const QString& GetAvatarUrlJob::avatarUrl() const
+{
+ return d->avatarUrl;
+}
+
+BaseJob::Status GetAvatarUrlJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ d->avatarUrl = fromJson<QString>(json.value("avatar_url"));
+ return Success;
+}
+
+class GetUserProfileJob::Private
+{
+ public:
+ QString avatarUrl;
+ QString displayname;
+};
+
+QUrl GetUserProfileJob::makeRequestUrl(QUrl baseUrl, const QString& userId)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/profile/" % userId);
+}
+
+GetUserProfileJob::GetUserProfileJob(const QString& userId)
+ : BaseJob(HttpVerb::Get, "GetUserProfileJob",
+ basePath % "/profile/" % userId, false)
+ , d(new Private)
+{
+}
+
+GetUserProfileJob::~GetUserProfileJob() = default;
+
+const QString& GetUserProfileJob::avatarUrl() const
+{
+ return d->avatarUrl;
+}
+
+const QString& GetUserProfileJob::displayname() const
+{
+ return d->displayname;
+}
+
+BaseJob::Status GetUserProfileJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ d->avatarUrl = fromJson<QString>(json.value("avatar_url"));
+ d->displayname = fromJson<QString>(json.value("displayname"));
+ return Success;
+}
+
diff --git a/lib/csapi/profile.h b/lib/csapi/profile.h
new file mode 100644
index 00000000..604291b4
--- /dev/null
+++ b/lib/csapi/profile.h
@@ -0,0 +1,105 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class SetDisplayNameJob : public BaseJob
+ {
+ public:
+ explicit SetDisplayNameJob(const QString& userId, const QString& displayname = {});
+ };
+
+ class GetDisplayNameJob : public BaseJob
+ {
+ public:
+ explicit GetDisplayNameJob(const QString& userId);
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetDisplayNameJob. This function can be used when
+ * a URL for GetDisplayNameJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId);
+
+ ~GetDisplayNameJob() override;
+
+ // Result properties
+
+ const QString& displayname() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+
+ class SetAvatarUrlJob : public BaseJob
+ {
+ public:
+ explicit SetAvatarUrlJob(const QString& userId, const QString& avatarUrl = {});
+ };
+
+ class GetAvatarUrlJob : public BaseJob
+ {
+ public:
+ explicit GetAvatarUrlJob(const QString& userId);
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetAvatarUrlJob. This function can be used when
+ * a URL for GetAvatarUrlJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId);
+
+ ~GetAvatarUrlJob() override;
+
+ // Result properties
+
+ const QString& avatarUrl() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+
+ class GetUserProfileJob : public BaseJob
+ {
+ public:
+ explicit GetUserProfileJob(const QString& userId);
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetUserProfileJob. This function can be used when
+ * a URL for GetUserProfileJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId);
+
+ ~GetUserProfileJob() override;
+
+ // Result properties
+
+ const QString& avatarUrl() const;
+ const QString& displayname() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/pusher.cpp b/lib/csapi/pusher.cpp
new file mode 100644
index 00000000..dea7cf8b
--- /dev/null
+++ b/lib/csapi/pusher.cpp
@@ -0,0 +1,121 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "pusher.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+namespace QMatrixClient
+{
+ // Converters
+
+ template <> struct FromJson<GetPushersJob::PusherData>
+ {
+ GetPushersJob::PusherData operator()(const QJsonValue& jv)
+ {
+ const auto& o = jv.toObject();
+ GetPushersJob::PusherData result;
+ result.url =
+ fromJson<QString>(o.value("url"));
+
+ return result;
+ }
+ };
+
+ template <> struct FromJson<GetPushersJob::Pusher>
+ {
+ GetPushersJob::Pusher operator()(const QJsonValue& jv)
+ {
+ const auto& o = jv.toObject();
+ GetPushersJob::Pusher result;
+ result.pushkey =
+ fromJson<QString>(o.value("pushkey"));
+ result.kind =
+ fromJson<QString>(o.value("kind"));
+ result.appId =
+ fromJson<QString>(o.value("app_id"));
+ result.appDisplayName =
+ fromJson<QString>(o.value("app_display_name"));
+ result.deviceDisplayName =
+ fromJson<QString>(o.value("device_display_name"));
+ result.profileTag =
+ fromJson<QString>(o.value("profile_tag"));
+ result.lang =
+ fromJson<QString>(o.value("lang"));
+ result.data =
+ fromJson<GetPushersJob::PusherData>(o.value("data"));
+
+ return result;
+ }
+ };
+} // namespace QMatrixClient
+
+class GetPushersJob::Private
+{
+ public:
+ QVector<Pusher> pushers;
+};
+
+QUrl GetPushersJob::makeRequestUrl(QUrl baseUrl)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/pushers");
+}
+
+GetPushersJob::GetPushersJob()
+ : BaseJob(HttpVerb::Get, "GetPushersJob",
+ basePath % "/pushers")
+ , d(new Private)
+{
+}
+
+GetPushersJob::~GetPushersJob() = default;
+
+const QVector<GetPushersJob::Pusher>& GetPushersJob::pushers() const
+{
+ return d->pushers;
+}
+
+BaseJob::Status GetPushersJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ d->pushers = fromJson<QVector<Pusher>>(json.value("pushers"));
+ return Success;
+}
+
+namespace QMatrixClient
+{
+ // Converters
+
+ QJsonObject toJson(const PostPusherJob::PusherData& pod)
+ {
+ QJsonObject o;
+ o.insert("url", toJson(pod.url));
+
+ return o;
+ }
+} // namespace QMatrixClient
+
+PostPusherJob::PostPusherJob(const QString& pushkey, const QString& kind, const QString& appId, const QString& appDisplayName, const QString& deviceDisplayName, const QString& lang, const PusherData& data, const QString& profileTag, bool append)
+ : BaseJob(HttpVerb::Post, "PostPusherJob",
+ basePath % "/pushers/set")
+{
+ QJsonObject _data;
+ _data.insert("pushkey", toJson(pushkey));
+ _data.insert("kind", toJson(kind));
+ _data.insert("app_id", toJson(appId));
+ _data.insert("app_display_name", toJson(appDisplayName));
+ _data.insert("device_display_name", toJson(deviceDisplayName));
+ if (!profileTag.isEmpty())
+ _data.insert("profile_tag", toJson(profileTag));
+ _data.insert("lang", toJson(lang));
+ _data.insert("data", toJson(data));
+ _data.insert("append", toJson(append));
+ setRequestData(_data);
+}
+
diff --git a/lib/csapi/pusher.h b/lib/csapi/pusher.h
new file mode 100644
index 00000000..97e3ba38
--- /dev/null
+++ b/lib/csapi/pusher.h
@@ -0,0 +1,78 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include <QtCore/QVector>
+
+#include "converters.h"
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class GetPushersJob : public BaseJob
+ {
+ public:
+ // Inner data structures
+
+ struct PusherData
+ {
+ QString url;
+ };
+
+ struct Pusher
+ {
+ QString pushkey;
+ QString kind;
+ QString appId;
+ QString appDisplayName;
+ QString deviceDisplayName;
+ QString profileTag;
+ QString lang;
+ PusherData data;
+ };
+
+ // Construction/destruction
+
+ explicit GetPushersJob();
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetPushersJob. This function can be used when
+ * a URL for GetPushersJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl);
+
+ ~GetPushersJob() override;
+
+ // Result properties
+
+ const QVector<Pusher>& pushers() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+
+ class PostPusherJob : public BaseJob
+ {
+ public:
+ // Inner data structures
+
+ struct PusherData
+ {
+ QString url;
+ };
+
+ // Construction/destruction
+
+ explicit PostPusherJob(const QString& pushkey, const QString& kind, const QString& appId, const QString& appDisplayName, const QString& deviceDisplayName, const QString& lang, const PusherData& data, const QString& profileTag = {}, bool append = {});
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/receipts.cpp b/lib/csapi/receipts.cpp
new file mode 100644
index 00000000..945e8673
--- /dev/null
+++ b/lib/csapi/receipts.cpp
@@ -0,0 +1,21 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "receipts.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+PostReceiptJob::PostReceiptJob(const QString& roomId, const QString& receiptType, const QString& eventId, const QJsonObject& receipt)
+ : BaseJob(HttpVerb::Post, "PostReceiptJob",
+ basePath % "/rooms/" % roomId % "/receipt/" % receiptType % "/" % eventId)
+{
+ setRequestData(Data(toJson(receipt)));
+}
+
diff --git a/lib/csapi/receipts.h b/lib/csapi/receipts.h
new file mode 100644
index 00000000..b109282e
--- /dev/null
+++ b/lib/csapi/receipts.h
@@ -0,0 +1,21 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include <QtCore/QJsonObject>
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class PostReceiptJob : public BaseJob
+ {
+ public:
+ explicit PostReceiptJob(const QString& roomId, const QString& receiptType, const QString& eventId, const QJsonObject& receipt = {});
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/redaction.cpp b/lib/csapi/redaction.cpp
new file mode 100644
index 00000000..0da35dfc
--- /dev/null
+++ b/lib/csapi/redaction.cpp
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "redaction.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+class RedactEventJob::Private
+{
+ public:
+ QString eventId;
+};
+
+RedactEventJob::RedactEventJob(const QString& roomId, const QString& eventId, const QString& txnId, const QString& reason)
+ : BaseJob(HttpVerb::Put, "RedactEventJob",
+ basePath % "/rooms/" % roomId % "/redact/" % eventId % "/" % txnId)
+ , d(new Private)
+{
+ QJsonObject _data;
+ if (!reason.isEmpty())
+ _data.insert("reason", toJson(reason));
+ setRequestData(_data);
+}
+
+RedactEventJob::~RedactEventJob() = default;
+
+const QString& RedactEventJob::eventId() const
+{
+ return d->eventId;
+}
+
+BaseJob::Status RedactEventJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ d->eventId = fromJson<QString>(json.value("event_id"));
+ return Success;
+}
+
diff --git a/lib/csapi/redaction.h b/lib/csapi/redaction.h
new file mode 100644
index 00000000..56645ee5
--- /dev/null
+++ b/lib/csapi/redaction.h
@@ -0,0 +1,32 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class RedactEventJob : public BaseJob
+ {
+ public:
+ explicit RedactEventJob(const QString& roomId, const QString& eventId, const QString& txnId, const QString& reason = {});
+ ~RedactEventJob() override;
+
+ // Result properties
+
+ const QString& eventId() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/room_send.cpp b/lib/csapi/room_send.cpp
new file mode 100644
index 00000000..9637a205
--- /dev/null
+++ b/lib/csapi/room_send.cpp
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "room_send.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+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(toJson(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<QString>(json.value("event_id"));
+ return Success;
+}
+
diff --git a/lib/csapi/room_send.h b/lib/csapi/room_send.h
new file mode 100644
index 00000000..3bfb48c4
--- /dev/null
+++ b/lib/csapi/room_send.h
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include <QtCore/QJsonObject>
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class SendMessageJob : public BaseJob
+ {
+ public:
+ explicit SendMessageJob(const QString& roomId, const QString& eventType, const QString& txnId, const QJsonObject& body = {});
+ ~SendMessageJob() override;
+
+ // Result properties
+
+ const QString& eventId() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/room_state.cpp b/lib/csapi/room_state.cpp
new file mode 100644
index 00000000..39f36afb
--- /dev/null
+++ b/lib/csapi/room_state.cpp
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "room_state.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+class SetRoomStateWithKeyJob::Private
+{
+ public:
+ QString eventId;
+};
+
+SetRoomStateWithKeyJob::SetRoomStateWithKeyJob(const QString& roomId, const QString& eventType, const QString& stateKey, const QJsonObject& body)
+ : BaseJob(HttpVerb::Put, "SetRoomStateWithKeyJob",
+ basePath % "/rooms/" % roomId % "/state/" % eventType % "/" % stateKey)
+ , d(new Private)
+{
+ setRequestData(Data(toJson(body)));
+}
+
+SetRoomStateWithKeyJob::~SetRoomStateWithKeyJob() = default;
+
+const QString& SetRoomStateWithKeyJob::eventId() const
+{
+ return d->eventId;
+}
+
+BaseJob::Status SetRoomStateWithKeyJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ d->eventId = fromJson<QString>(json.value("event_id"));
+ return Success;
+}
+
+class SetRoomStateJob::Private
+{
+ public:
+ QString eventId;
+};
+
+SetRoomStateJob::SetRoomStateJob(const QString& roomId, const QString& eventType, const QJsonObject& body)
+ : BaseJob(HttpVerb::Put, "SetRoomStateJob",
+ basePath % "/rooms/" % roomId % "/state/" % eventType)
+ , d(new Private)
+{
+ setRequestData(Data(toJson(body)));
+}
+
+SetRoomStateJob::~SetRoomStateJob() = default;
+
+const QString& SetRoomStateJob::eventId() const
+{
+ return d->eventId;
+}
+
+BaseJob::Status SetRoomStateJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ d->eventId = fromJson<QString>(json.value("event_id"));
+ return Success;
+}
+
diff --git a/lib/csapi/room_state.h b/lib/csapi/room_state.h
new file mode 100644
index 00000000..5c42b868
--- /dev/null
+++ b/lib/csapi/room_state.h
@@ -0,0 +1,51 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include <QtCore/QJsonObject>
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class SetRoomStateWithKeyJob : public BaseJob
+ {
+ public:
+ explicit SetRoomStateWithKeyJob(const QString& roomId, const QString& eventType, const QString& stateKey, const QJsonObject& body = {});
+ ~SetRoomStateWithKeyJob() override;
+
+ // Result properties
+
+ const QString& eventId() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+
+ class SetRoomStateJob : public BaseJob
+ {
+ public:
+ explicit SetRoomStateJob(const QString& roomId, const QString& eventType, const QJsonObject& body = {});
+ ~SetRoomStateJob() override;
+
+ // Result properties
+
+ const QString& eventId() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/tags.cpp b/lib/csapi/tags.cpp
new file mode 100644
index 00000000..9cd78aec
--- /dev/null
+++ b/lib/csapi/tags.cpp
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "tags.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+class GetRoomTagsJob::Private
+{
+ public:
+ QJsonObject tags;
+};
+
+QUrl GetRoomTagsJob::makeRequestUrl(QUrl baseUrl, const QString& userId, const QString& roomId)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/user/" % userId % "/rooms/" % roomId % "/tags");
+}
+
+GetRoomTagsJob::GetRoomTagsJob(const QString& userId, const QString& roomId)
+ : BaseJob(HttpVerb::Get, "GetRoomTagsJob",
+ basePath % "/user/" % userId % "/rooms/" % roomId % "/tags")
+ , d(new Private)
+{
+}
+
+GetRoomTagsJob::~GetRoomTagsJob() = default;
+
+const QJsonObject& GetRoomTagsJob::tags() const
+{
+ return d->tags;
+}
+
+BaseJob::Status GetRoomTagsJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ d->tags = fromJson<QJsonObject>(json.value("tags"));
+ return Success;
+}
+
+SetRoomTagJob::SetRoomTagJob(const QString& userId, const QString& roomId, const QString& tag, const QJsonObject& body)
+ : BaseJob(HttpVerb::Put, "SetRoomTagJob",
+ basePath % "/user/" % userId % "/rooms/" % roomId % "/tags/" % tag)
+{
+ setRequestData(Data(toJson(body)));
+}
+
+QUrl DeleteRoomTagJob::makeRequestUrl(QUrl baseUrl, const QString& userId, const QString& roomId, const QString& tag)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/user/" % userId % "/rooms/" % roomId % "/tags/" % tag);
+}
+
+DeleteRoomTagJob::DeleteRoomTagJob(const QString& userId, const QString& roomId, const QString& tag)
+ : BaseJob(HttpVerb::Delete, "DeleteRoomTagJob",
+ basePath % "/user/" % userId % "/rooms/" % roomId % "/tags/" % tag)
+{
+}
+
diff --git a/lib/csapi/tags.h b/lib/csapi/tags.h
new file mode 100644
index 00000000..e437cee8
--- /dev/null
+++ b/lib/csapi/tags.h
@@ -0,0 +1,61 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include <QtCore/QJsonObject>
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class GetRoomTagsJob : public BaseJob
+ {
+ public:
+ explicit GetRoomTagsJob(const QString& userId, const QString& roomId);
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetRoomTagsJob. This function can be used when
+ * a URL for GetRoomTagsJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId, const QString& roomId);
+
+ ~GetRoomTagsJob() override;
+
+ // Result properties
+
+ const QJsonObject& tags() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+
+ class SetRoomTagJob : public BaseJob
+ {
+ public:
+ explicit SetRoomTagJob(const QString& userId, const QString& roomId, const QString& tag, const QJsonObject& body = {});
+ };
+
+ class DeleteRoomTagJob : public BaseJob
+ {
+ public:
+ explicit DeleteRoomTagJob(const QString& userId, const QString& roomId, const QString& tag);
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * DeleteRoomTagJob. This function can be used when
+ * a URL for DeleteRoomTagJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId, const QString& roomId, const QString& tag);
+
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/third_party_membership.cpp b/lib/csapi/third_party_membership.cpp
new file mode 100644
index 00000000..b637d481
--- /dev/null
+++ b/lib/csapi/third_party_membership.cpp
@@ -0,0 +1,25 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "third_party_membership.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+InviteBy3PIDJob::InviteBy3PIDJob(const QString& roomId, const QString& idServer, const QString& medium, const QString& address)
+ : BaseJob(HttpVerb::Post, "InviteBy3PIDJob",
+ basePath % "/rooms/" % roomId % "/invite")
+{
+ QJsonObject _data;
+ _data.insert("id_server", toJson(idServer));
+ _data.insert("medium", toJson(medium));
+ _data.insert("address", toJson(address));
+ setRequestData(_data);
+}
+
diff --git a/lib/csapi/third_party_membership.h b/lib/csapi/third_party_membership.h
new file mode 100644
index 00000000..9cf6e6f6
--- /dev/null
+++ b/lib/csapi/third_party_membership.h
@@ -0,0 +1,20 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class InviteBy3PIDJob : public BaseJob
+ {
+ public:
+ explicit InviteBy3PIDJob(const QString& roomId, const QString& idServer, const QString& medium, const QString& address);
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/to_device.cpp b/lib/csapi/to_device.cpp
new file mode 100644
index 00000000..e893fa44
--- /dev/null
+++ b/lib/csapi/to_device.cpp
@@ -0,0 +1,23 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "to_device.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+SendToDeviceJob::SendToDeviceJob(const QString& eventType, const QString& txnId, const QHash<QString, QHash<QString, QJsonObject>>& messages)
+ : BaseJob(HttpVerb::Put, "SendToDeviceJob",
+ basePath % "/sendToDevice/" % eventType % "/" % txnId)
+{
+ QJsonObject _data;
+ _data.insert("messages", toJson(messages));
+ setRequestData(_data);
+}
+
diff --git a/lib/csapi/to_device.h b/lib/csapi/to_device.h
new file mode 100644
index 00000000..7743b883
--- /dev/null
+++ b/lib/csapi/to_device.h
@@ -0,0 +1,22 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include <QtCore/QJsonObject>
+#include <QtCore/QHash>
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class SendToDeviceJob : public BaseJob
+ {
+ public:
+ explicit SendToDeviceJob(const QString& eventType, const QString& txnId, const QHash<QString, QHash<QString, QJsonObject>>& messages = {});
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/typing.cpp b/lib/csapi/typing.cpp
new file mode 100644
index 00000000..fa700290
--- /dev/null
+++ b/lib/csapi/typing.cpp
@@ -0,0 +1,24 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "typing.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+SetTypingJob::SetTypingJob(const QString& userId, const QString& roomId, bool typing, int timeout)
+ : BaseJob(HttpVerb::Put, "SetTypingJob",
+ basePath % "/rooms/" % roomId % "/typing/" % userId)
+{
+ QJsonObject _data;
+ _data.insert("typing", toJson(typing));
+ _data.insert("timeout", toJson(timeout));
+ setRequestData(_data);
+}
+
diff --git a/lib/csapi/typing.h b/lib/csapi/typing.h
new file mode 100644
index 00000000..0506c77b
--- /dev/null
+++ b/lib/csapi/typing.h
@@ -0,0 +1,20 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class SetTypingJob : public BaseJob
+ {
+ public:
+ explicit SetTypingJob(const QString& userId, const QString& roomId, bool typing, int timeout = {});
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/users.cpp b/lib/csapi/users.cpp
new file mode 100644
index 00000000..fd2944e4
--- /dev/null
+++ b/lib/csapi/users.cpp
@@ -0,0 +1,78 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "users.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+namespace QMatrixClient
+{
+ // Converters
+
+ template <> struct FromJson<SearchUserDirectoryJob::User>
+ {
+ SearchUserDirectoryJob::User operator()(const QJsonValue& jv)
+ {
+ const auto& o = jv.toObject();
+ SearchUserDirectoryJob::User result;
+ result.userId =
+ fromJson<QString>(o.value("user_id"));
+ result.displayName =
+ fromJson<QString>(o.value("display_name"));
+ result.avatarUrl =
+ fromJson<QString>(o.value("avatar_url"));
+
+ return result;
+ }
+ };
+} // namespace QMatrixClient
+
+class SearchUserDirectoryJob::Private
+{
+ public:
+ QVector<User> results;
+ bool limited;
+};
+
+SearchUserDirectoryJob::SearchUserDirectoryJob(const QString& searchTerm, int limit)
+ : BaseJob(HttpVerb::Post, "SearchUserDirectoryJob",
+ basePath % "/user_directory/search")
+ , d(new Private)
+{
+ QJsonObject _data;
+ _data.insert("search_term", toJson(searchTerm));
+ _data.insert("limit", toJson(limit));
+ setRequestData(_data);
+}
+
+SearchUserDirectoryJob::~SearchUserDirectoryJob() = default;
+
+const QVector<SearchUserDirectoryJob::User>& SearchUserDirectoryJob::results() const
+{
+ return d->results;
+}
+
+bool SearchUserDirectoryJob::limited() const
+{
+ return d->limited;
+}
+
+BaseJob::Status SearchUserDirectoryJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ if (!json.contains("results"))
+ return { JsonParseError,
+ "The key 'results' not found in the response" };
+ d->results = fromJson<QVector<User>>(json.value("results"));
+ if (!json.contains("limited"))
+ return { JsonParseError,
+ "The key 'limited' not found in the response" };
+ d->limited = fromJson<bool>(json.value("limited"));
+ return Success;
+}
+
diff --git a/lib/csapi/users.h b/lib/csapi/users.h
new file mode 100644
index 00000000..85ebd47c
--- /dev/null
+++ b/lib/csapi/users.h
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include <QtCore/QVector>
+
+#include "converters.h"
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class SearchUserDirectoryJob : public BaseJob
+ {
+ public:
+ // Inner data structures
+
+ struct User
+ {
+ QString userId;
+ QString displayName;
+ QString avatarUrl;
+ };
+
+ // Construction/destruction
+
+ explicit SearchUserDirectoryJob(const QString& searchTerm, int limit = {});
+ ~SearchUserDirectoryJob() override;
+
+ // Result properties
+
+ const QVector<User>& results() const;
+ bool limited() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/versions.cpp b/lib/csapi/versions.cpp
new file mode 100644
index 00000000..7b55b94f
--- /dev/null
+++ b/lib/csapi/versions.cpp
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "versions.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client");
+
+class GetVersionsJob::Private
+{
+ public:
+ QStringList versions;
+};
+
+QUrl GetVersionsJob::makeRequestUrl(QUrl baseUrl)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/versions");
+}
+
+GetVersionsJob::GetVersionsJob()
+ : BaseJob(HttpVerb::Get, "GetVersionsJob",
+ basePath % "/versions", false)
+ , d(new Private)
+{
+}
+
+GetVersionsJob::~GetVersionsJob() = default;
+
+const QStringList& GetVersionsJob::versions() const
+{
+ return d->versions;
+}
+
+BaseJob::Status GetVersionsJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ d->versions = fromJson<QStringList>(json.value("versions"));
+ return Success;
+}
+
diff --git a/lib/csapi/versions.h b/lib/csapi/versions.h
new file mode 100644
index 00000000..c386f0af
--- /dev/null
+++ b/lib/csapi/versions.h
@@ -0,0 +1,41 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+#include <QtCore/QStringList>
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class GetVersionsJob : public BaseJob
+ {
+ public:
+ explicit GetVersionsJob();
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetVersionsJob. This function can be used when
+ * a URL for GetVersionsJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl);
+
+ ~GetVersionsJob() override;
+
+ // Result properties
+
+ const QStringList& versions() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/whoami.cpp b/lib/csapi/whoami.cpp
new file mode 100644
index 00000000..4c231b5f
--- /dev/null
+++ b/lib/csapi/whoami.cpp
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "whoami.h"
+
+#include "converters.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+class GetTokenOwnerJob::Private
+{
+ public:
+ QString userId;
+};
+
+QUrl GetTokenOwnerJob::makeRequestUrl(QUrl baseUrl)
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath % "/account/whoami");
+}
+
+GetTokenOwnerJob::GetTokenOwnerJob()
+ : BaseJob(HttpVerb::Get, "GetTokenOwnerJob",
+ basePath % "/account/whoami")
+ , d(new Private)
+{
+}
+
+GetTokenOwnerJob::~GetTokenOwnerJob() = default;
+
+const QString& GetTokenOwnerJob::userId() const
+{
+ return d->userId;
+}
+
+BaseJob::Status GetTokenOwnerJob::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ if (!json.contains("user_id"))
+ return { JsonParseError,
+ "The key 'user_id' not found in the response" };
+ d->userId = fromJson<QString>(json.value("user_id"));
+ return Success;
+}
+
diff --git a/lib/csapi/whoami.h b/lib/csapi/whoami.h
new file mode 100644
index 00000000..08fcb5a3
--- /dev/null
+++ b/lib/csapi/whoami.h
@@ -0,0 +1,40 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#pragma once
+
+#include "jobs/basejob.h"
+
+
+
+namespace QMatrixClient
+{
+ // Operations
+
+ class GetTokenOwnerJob : public BaseJob
+ {
+ public:
+ explicit GetTokenOwnerJob();
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * GetTokenOwnerJob. This function can be used when
+ * a URL for GetTokenOwnerJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl);
+
+ ~GetTokenOwnerJob() override;
+
+ // Result properties
+
+ const QString& userId() const;
+
+ protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;
+ };
+} // namespace QMatrixClient
diff --git a/lib/csapi/{{base}}.cpp.mustache b/lib/csapi/{{base}}.cpp.mustache
new file mode 100644
index 00000000..d3726f1e
--- /dev/null
+++ b/lib/csapi/{{base}}.cpp.mustache
@@ -0,0 +1,121 @@
+{{#@filePartial}}preamble{{/@filePartial}}
+#include "{{filenameBase}}.h"
+{{^allModels}}
+#include "converters.h"
+{{/allModels}}{{#operations}}
+{{#producesNonJson?}}#include <QtNetwork/QNetworkReply>
+{{/producesNonJson?}}#include <QtCore/QStringBuilder>
+{{/operations}}
+using namespace QMatrixClient;
+{{#models.model}}{{#in?}}
+QJsonObject QMatrixClient::toJson(const {{qualifiedName}}& pod)
+{
+ QJsonObject o;
+{{#vars}} o.insert("{{baseName}}", toJson(pod.{{nameCamelCase}}));
+{{/vars}}
+ return o;
+}
+{{/in?}}{{#out?}}
+{{qualifiedName}} FromJson<{{qualifiedName}}>::operator()(const QJsonValue& jv)
+{
+ const auto& o = jv.toObject();
+ {{qualifiedName}} result;
+ {{#vars}}result.{{nameCamelCase}} =
+ fromJson<{{dataType.name}}>(o.value("{{baseName}}"));
+ {{/vars}}
+ return result;
+}
+{{/out?}}{{/models.model}}{{#operations}}
+static const auto basePath = QStringLiteral("{{basePathWithoutHost}}");
+{{# operation}}{{#models}}
+namespace QMatrixClient
+{
+ // Converters
+{{#model}}{{#in?}}
+ QJsonObject toJson(const {{qualifiedName}}& pod)
+ {
+ QJsonObject o;
+{{#vars}} o.insert("{{baseName}}", toJson(pod.{{nameCamelCase}}));
+{{/vars}}
+ return o;
+ }
+{{/in?}}{{#out?}}
+ template <> struct FromJson<{{qualifiedName}}>
+ {
+ {{qualifiedName}} operator()(const QJsonValue& jv)
+ {
+ const auto& o = jv.toObject();
+ {{qualifiedName}} result;
+{{#vars}} result.{{nameCamelCase}} =
+ fromJson<{{dataType.qualifiedName}}>(o.value("{{baseName}}"));
+{{/vars}}
+ return result;
+ }
+ };
+{{/out?}}{{/model}}} // namespace QMatrixClient
+{{/ models}}{{#responses}}{{#normalResponse?}}{{#allProperties?}}
+class {{camelCaseOperationId}}Job::Private
+{
+ public:{{#allProperties}}
+ {{dataType.name}} {{paramName}};{{/allProperties}}
+};
+{{/ allProperties?}}{{/normalResponse?}}{{/responses}}{{#queryParams?}}
+BaseJob::Query queryTo{{camelCaseOperationId}}({{#queryParams}}{{>joinedParamDef}}{{/queryParams}})
+{
+ BaseJob::Query _q;{{#queryParams}}
+{{^required?}}{{#string?}} if (!{{nameCamelCase}}.isEmpty())
+ {{/string?}}{{/required?}} _q.addQueryItem("{{baseName}}", {{>paramToString}});{{/queryParams}}
+ return _q;
+}
+{{/queryParams?}}{{^bodyParams}}
+QUrl {{camelCaseOperationId}}Job::makeRequestUrl(QUrl baseUrl{{#allParams?}}, {{#allParams}}{{>joinedParamDef}}{{/allParams}}{{/allParams?}})
+{
+ return BaseJob::makeRequestUrl(std::move(baseUrl),
+ basePath{{#pathParts}} % {{_}}{{/pathParts}}{{#queryParams?}},
+ queryTo{{camelCaseOperationId}}({{>passQueryParams}}){{/queryParams?}});
+}
+{{/ bodyParams}}
+{{camelCaseOperationId}}Job::{{camelCaseOperationId}}Job({{#allParams}}{{>joinedParamDef}}{{/allParams}})
+ : BaseJob(HttpVerb::{{#@cap}}{{#@tolower}}{{httpMethod}}{{/@tolower}}{{/@cap}}, "{{camelCaseOperationId}}Job",
+ basePath{{#pathParts}} % {{_}}{{/pathParts}}{{#queryParams?}},
+ queryTo{{camelCaseOperationId}}({{>passQueryParams}}){{/queryParams?}}{{#skipAuth}}{{#queryParams?}},
+ {}{{/queryParams?}}, false{{/skipAuth}}){{#responses}}{{#normalResponse?}}{{#allProperties?}}
+ , d(new Private){{/allProperties?}}{{/normalResponse?}}{{/responses}}
+{
+{{#headerParams?}}{{#headerParams}} setRequestHeader("{{baseName}}", {{paramName}}.toLatin1());
+{{/headerParams}}
+{{/headerParams?
+}}{{#bodyParams?
+}}{{#inlineBody}} setRequestData(Data({{!
+ }}{{#consumesNonJson?}}{{nameCamelCase}}{{/consumesNonJson?
+ }}{{^consumesNonJson?}}toJson({{nameCamelCase}}){{/consumesNonJson?}}));{{/inlineBody
+}}{{^inlineBody}} QJsonObject _data;{{#bodyParams}}
+{{^required?}}{{#string?}} if (!{{paramName}}.isEmpty())
+ {{/string?}}{{/required?}} _data.insert("{{baseName}}", toJson({{paramName}}));{{/bodyParams}}
+ setRequestData(_data);{{/inlineBody}}
+{{/bodyParams?}}{{#producesNonJson?}} setExpectedContentTypes({ {{#produces}}"{{_}}"{{#@join}}, {{/@join}}{{/produces}} });
+{{/producesNonJson?}}}{{!<- mind the actual brace}}
+{{# responses}}{{#normalResponse?}}{{#allProperties?}}
+{{camelCaseOperationId}}Job::~{{camelCaseOperationId}}Job() = default;
+{{# allProperties}}
+{{>qualifiedMaybeCrefType}} {{camelCaseOperationId}}Job::{{paramName}}(){{^noCopy?}} const{{/noCopy?}}
+{
+ return {{#noCopy?}}std::move({{/noCopy?}}d->{{paramName}}{{#noCopy?}}){{/noCopy?}};
+}
+{{/ allProperties}}{{#producesNonJson?}}
+BaseJob::Status {{camelCaseOperationId}}Job::parseReply(QNetworkReply* reply)
+{
+ {{#headers}}d->{{paramName}} = reply->rawHeader("{{baseName}}"); {{! We don't check for required headers yet }}
+ {{/headers}}{{#properties}}d->{{paramName}} = reply;{{/properties}}
+ return Success;
+}{{/ producesNonJson?}}{{^producesNonJson?}}
+BaseJob::Status {{camelCaseOperationId}}Job::parseJson(const QJsonDocument& data)
+{
+ auto json = data.object();
+ {{# properties}}{{#required?}}if (!json.contains("{{baseName}}"))
+ return { JsonParseError,
+ "The key '{{baseName}}' not found in the response" };
+ {{/required?}}d->{{paramName}} = fromJson<{{dataType.name}}>(json.value("{{baseName}}"));
+ {{/ properties}}return Success;
+}{{/ producesNonJson?}}
+{{/allProperties?}}{{/normalResponse?}}{{/responses}}{{/operation}}{{/operations}}
diff --git a/lib/csapi/{{base}}.h.mustache b/lib/csapi/{{base}}.h.mustache
new file mode 100644
index 00000000..a9bed527
--- /dev/null
+++ b/lib/csapi/{{base}}.h.mustache
@@ -0,0 +1,63 @@
+{{#@filePartial}}preamble{{/@filePartial}}
+#pragma once
+
+{{#operations}}#include "jobs/basejob.h"
+{{/operations}}
+{{#imports}}#include {{_}}
+{{/imports}}
+{{#allModels}}#include "converters.h"
+{{/allModels}}
+namespace QMatrixClient
+{
+{{#models}} // Data structures
+{{# model}}
+ struct {{name}}{{#parents?}} : {{#parents}}{{name}}{{#@join}}, {{/@join}}{{/parents}}{{/parents?}}
+ {
+{{#vars}} {{dataType.name}} {{nameCamelCase}};
+{{/vars}} };
+{{#in?}}
+ QJsonObject toJson(const {{name}}& pod);
+{{/in?}}{{#out?}}
+ template <> struct FromJson<{{name}}>
+ {
+ {{name}} operator()(const QJsonValue& jv);
+ };
+{{/ out?}}{{/model}}
+{{/models}}{{#operations}} // Operations
+{{# operation}}
+ class {{camelCaseOperationId}}Job : public BaseJob
+ {
+ public:{{#models}}
+ // Inner data structures
+{{# model}}
+ struct {{name}}{{#parents?}} : {{#parents}}{{name}}{{#@join}}, {{/@join}}{{/parents}}{{/parents?}}
+ {
+{{#vars}} {{dataType.name}} {{nameCamelCase}};
+{{/vars}} };
+{{/ model}}
+ // Construction/destruction
+{{/ models}}
+ explicit {{camelCaseOperationId}}Job({{#allParams}}{{>joinedParamDecl}}{{/allParams}});{{^bodyParams}}
+
+ /** Construct a URL out of baseUrl and usual parameters passed to
+ * {{camelCaseOperationId}}Job. This function can be used when
+ * a URL for {{camelCaseOperationId}}Job is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl{{#allParams?}}, {{#allParams}}{{>joinedParamDecl}}{{/allParams}}{{/allParams?}});
+{{/bodyParams}}{{# responses}}{{#normalResponse?}}{{#allProperties?}}
+ ~{{camelCaseOperationId}}Job() override;
+
+ // Result properties
+{{#allProperties}}
+ {{>maybeCrefType}} {{paramName}}(){{^noCopy?}} const{{/noCopy?}};{{/allProperties}}
+
+ protected:
+ Status {{#producesNonJson?}}parseReply(QNetworkReply* reply){{/producesNonJson?}}{{^producesNonJson?}}parseJson(const QJsonDocument& data){{/producesNonJson?}} override;
+
+ private:
+ class Private;
+ QScopedPointer<Private> d;{{/allProperties?}}{{/normalResponse?}}{{/responses}}
+ };
+{{/operation}}{{/operations}}{{!skip EOL
+}}} // namespace QMatrixClient