aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/versions.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2020-06-09 08:52:25 +0200
committerGitHub <noreply@github.com>2020-06-09 08:52:25 +0200
commit370d9b3e46332d38df8798cda208c534c58be808 (patch)
treef3db0cd7463468ff52c74446acd608356f8b8ab6 /lib/csapi/versions.h
parente1f5d0aa2c33e6da6c3a609c8bc7e0b5867e748d (diff)
parent10d9ac4673e374a9ac17ff492591136520337c4c (diff)
downloadlibquotient-370d9b3e46332d38df8798cda208c534c58be808.tar.gz
libquotient-370d9b3e46332d38df8798cda208c534c58be808.zip
Merge pull request #405 from quotient-im/kitsune-basejob-store-json-response
Store JSON response in BaseJob + tweaks to the generated code
Diffstat (limited to 'lib/csapi/versions.h')
-rw-r--r--lib/csapi/versions.h24
1 files changed, 8 insertions, 16 deletions
diff --git a/lib/csapi/versions.h b/lib/csapi/versions.h
index 4c4f8109..828a7eb9 100644
--- a/lib/csapi/versions.h
+++ b/lib/csapi/versions.h
@@ -4,16 +4,10 @@
#pragma once
-#include "converters.h"
-
#include "jobs/basejob.h"
-#include <QtCore/QHash>
-
namespace Quotient {
-// Operations
-
/*! \brief Gets the versions of the specification supported by the server.
*
* Gets the versions of the specification supported by the server.
@@ -48,24 +42,22 @@ public:
* is necessary but the job itself isn't.
*/
static QUrl makeRequestUrl(QUrl baseUrl);
- ~GetVersionsJob() override;
// Result properties
/// The supported versions.
- const QStringList& versions() const;
+ QStringList versions() const
+ {
+ return loadFromJson<QStringList>("versions"_ls);
+ }
/// Experimental features the server supports. Features not listed here,
/// or the lack of this property all together, indicate that a feature is
/// not supported.
- const QHash<QString, bool>& unstableFeatures() const;
-
-protected:
- Status parseJson(const QJsonDocument& data) override;
-
-private:
- class Private;
- QScopedPointer<Private> d;
+ QHash<QString, bool> unstableFeatures() const
+ {
+ return loadFromJson<QHash<QString, bool>>("unstable_features"_ls);
+ }
};
} // namespace Quotient