aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/wellknown.h
blob: df4c8c6e13167523c174d0a0677707e949364c03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/******************************************************************************
 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
 */

#pragma once

#include "jobs/basejob.h"

#include "converters.h"
#include "csapi/definitions/wellknown/identity_server.h"
#include "csapi/definitions/wellknown/homeserver.h"

namespace QMatrixClient
{
    // Operations

    /// Gets Matrix server discovery information about the domain.
    ///
    /// Gets discovery information about the domain. The file may include
    /// additional keys, which MUST follow the Java package naming convention,
    /// e.g. ``com.example.myapp.property``. This ensures property names are
    /// suitably namespaced for each application and reduces the risk of
    /// clashes.
    /// 
    /// Note that this endpoint is not necessarily handled by the homeserver,
    /// but by another webserver, to be used for discovering the homeserver URL.
    class GetWellknownJob : public BaseJob
    {
        public:
            explicit GetWellknownJob();

            /*! Construct a URL without creating a full-fledged job object
             *
             * This function can be used when a URL for
             * GetWellknownJob is necessary but the job
             * itself isn't.
             */
            static QUrl makeRequestUrl(QUrl baseUrl);

            ~GetWellknownJob() override;

            // Result properties

            /// Information about the homeserver to connect to.
            const HomeserverInformation& homeserver() const;
            /// Optional. Information about the identity server to connect to.
            const Omittable<IdentityServerInformation>& identityServer() const;

        protected:
            Status parseJson(const QJsonDocument& data) override;

        private:
            class Private;
            QScopedPointer<Private> d;
    };
} // namespace QMatrixClient