aboutsummaryrefslogtreecommitdiff
path: root/lib/jobs/generated/notifications.h
blob: 798b95768a1c66a6540f1ff1276d388e74e4896b (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
57
58
/******************************************************************************
 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
 */

#pragma once

#include "../basejob.h"

#include <vector>
#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;
                
            };

            // End of inner data structures

            /** 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 = {});

            explicit GetNotificationsJob(const QString& from = {}, int limit = {}, const QString& only = {});
            ~GetNotificationsJob() override;

            const QString& nextToken() const;
            const std::vector<Notification>& notifications() const;

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

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