1/******************************************************************************
2 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
3 */
4
5#pragma once
6
7#include <Quotient/jobs/basejob.h>
8
9namespace Quotient {
10
11/*! \brief Gets the versions of the specification supported by the server.
12 *
13 * Gets the versions of the specification supported by the server.
14 *
15 * Values will take the form `vX.Y` or `rX.Y.Z` in historical cases. See
16 * [the Specification Versioning](../#specification-versions) for more
17 * information.
18 *
19 * The server may additionally advertise experimental features it supports
20 * through `unstable_features`. These features should be namespaced and
21 * may optionally include version information within their name if desired.
22 * Features listed here are not for optionally toggling parts of the Matrix
23 * specification and should only be used to advertise support for a feature
24 * which has not yet landed in the spec. For example, a feature currently
25 * undergoing the proposal process may appear here and eventually be taken
26 * off this list once the feature lands in the spec and the server deems it
27 * reasonable to do so. Servers may wish to keep advertising features here
28 * after they've been released into the spec to give clients a chance to
29 * upgrade appropriately. Additionally, clients should avoid using unstable
30 * features in their stable releases.
31 */
32class QUOTIENT_API GetVersionsJob : public BaseJob {
33public:
34 /// Gets the versions of the specification supported by the server.
35 explicit GetVersionsJob();
36
37 /*! \brief Construct a URL without creating a full-fledged job object
38 *
39 * This function can be used when a URL for GetVersionsJob
40 * is necessary but the job itself isn't.
41 */
42 static QUrl makeRequestUrl(QUrl baseUrl);
43
44 // Result properties
45
46 /// The supported versions.
47 QStringList versions() const
48 {
49 return loadFromJson<QStringList>(keyName: "versions"_ls);
50 }
51
52 /// Experimental features the server supports. Features not listed here,
53 /// or the lack of this property all together, indicate that a feature is
54 /// not supported.
55 QHash<QString, bool> unstableFeatures() const
56 {
57 return loadFromJson<QHash<QString, bool>>(keyName: "unstable_features"_ls);
58 }
59};
60
61} // namespace Quotient
62