diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-10-19 08:12:50 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-10-19 08:14:56 +0900 |
commit | ecc364d4ad752b34e41b717e3deff4d17a840378 (patch) | |
tree | ca1077fb3a751ad01f6638ee5733ddd4583d005f /jobs/generated/profile.cpp | |
parent | 8800690c691dc9534fdb0f2d902862f816704d50 (diff) | |
parent | f2f85ba093df5dcd991fd206af4d79d57f4c7fc8 (diff) | |
download | libquotient-ecc364d4ad752b34e41b717e3deff4d17a840378.tar.gz libquotient-ecc364d4ad752b34e41b717e3deff4d17a840378.zip |
Merge branch 'master' into kitsune-gtad
Diffstat (limited to 'jobs/generated/profile.cpp')
-rw-r--r-- | jobs/generated/profile.cpp | 144 |
1 files changed, 144 insertions, 0 deletions
diff --git a/jobs/generated/profile.cpp b/jobs/generated/profile.cpp new file mode 100644 index 00000000..9d20a480 --- /dev/null +++ b/jobs/generated/profile.cpp @@ -0,0 +1,144 @@ +/****************************************************************************** + * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN + */ + + +#include "profile.h" + +#include "jobs/converters.h" +#include <QtCore/QStringBuilder> + +using namespace QMatrixClient; + +static const auto basePath = QStringLiteral("/_matrix/client/r0"); + +SetDisplayNameJob::SetDisplayNameJob(QString userId, QString displayname) + : BaseJob(HttpVerb::Put, "SetDisplayNameJob", + basePath % "/profile/" % userId % "/displayname", + Query { }, + Data { + { "displayname", toJson(displayname) } + } + ) +{ } + +class GetDisplayNameJob::Private +{ + public: + QString displayname; + +}; + +GetDisplayNameJob::GetDisplayNameJob(QString userId) + : BaseJob(HttpVerb::Get, "GetDisplayNameJob", + basePath % "/profile/" % userId % "/displayname", + Query { }, + Data { } + ), d(new Private) +{ } + +GetDisplayNameJob::~GetDisplayNameJob() +{ + delete d; +} + +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(QString userId, QString avatar_url) + : BaseJob(HttpVerb::Put, "SetAvatarUrlJob", + basePath % "/profile/" % userId % "/avatar_url", + Query { }, + Data { + { "avatar_url", toJson(avatar_url) } + } + ) +{ } + +class GetAvatarUrlJob::Private +{ + public: + QString avatar_url; + +}; + +GetAvatarUrlJob::GetAvatarUrlJob(QString userId) + : BaseJob(HttpVerb::Get, "GetAvatarUrlJob", + basePath % "/profile/" % userId % "/avatar_url", + Query { }, + Data { } + ), d(new Private) +{ } + +GetAvatarUrlJob::~GetAvatarUrlJob() +{ + delete d; +} + +const QString& GetAvatarUrlJob::avatar_url() const +{ + return d->avatar_url; +} + +BaseJob::Status GetAvatarUrlJob::parseJson(const QJsonDocument& data) +{ + auto json = data.object(); + + d->avatar_url = fromJson<QString>(json.value("avatar_url")); + + return Success; +} + +class GetUserProfileJob::Private +{ + public: + QString avatar_url; + QString displayname; + +}; + +GetUserProfileJob::GetUserProfileJob(QString userId) + : BaseJob(HttpVerb::Get, "GetUserProfileJob", + basePath % "/profile/" % userId, + Query { }, + Data { } + ), d(new Private) +{ } + +GetUserProfileJob::~GetUserProfileJob() +{ + delete d; +} + +const QString& GetUserProfileJob::avatar_url() const +{ + return d->avatar_url; +} + +const QString& GetUserProfileJob::displayname() const +{ + return d->displayname; +} + +BaseJob::Status GetUserProfileJob::parseJson(const QJsonDocument& data) +{ + auto json = data.object(); + + d->avatar_url = fromJson<QString>(json.value("avatar_url")); + + d->displayname = fromJson<QString>(json.value("displayname")); + + return Success; +} + |