aboutsummaryrefslogtreecommitdiff
path: root/.gitignore
blob: e9b0b91c14e203432a527177eb85b6ebaa28b159 (plain)
1
2
3
4
5
6
7
8
9
10
build
.kdev4

# Qt Creator project file
*.user

# qmake derivatives
Makefile*
object_script.*
.qmake*
.ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/******************************************************************************
 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
 */

#pragma once

#include "converters.h"

#include "events/eventloader.h"
#include "jobs/basejob.h"

#include <QtCore/QJsonObject>
#include <QtCore/QVariant>
#include <QtCore/QVector>

namespace QMatrixClient
{

// Operations

/// Gets a list of events that the user has been notified about
/*!
 * This API is used to paginate through the list of events that the
 * user has been, or would have been notified about.
 */
class GetNotificationsJob : public BaseJob
{
public:
    // Inner data structures

    /// This API is used to paginate through the list of events that theuser has
    /// been, or would have been notified about.
    struct Notification
    {
        /// The action(s) to perform when the conditions for this rule are
        /// met.See `Push Rules: API`_.
        QVector<QVariant> actions;
        /// The Event object for the event that triggered the notification.
        EventPtr event;
        /// The profile tag of the rule that matched this event.
        QString profileTag;
        /// Indicates whether the user has sent a read receipt indicatingthat
        /// they have read this message.
        bool read;
        /// The ID of the room in which the event was posted.
        QString roomId;
        /// The unix timestamp at which the event notification was sent,in
        /// milliseconds.
        int ts;
    };

    // Construction/destruction

    /*! Gets a list of events that the user has been notified about
     * \param from
     *   Pagination token given to retrieve the next set of events.
     * \param limit
     *   Limit on the number of events to return in this request.
     * \param only
     *   Allows basic filtering of events returned. Supply ``highlight``
     *   to return only events where the notification had the highlight
     *   tweak set.
     */
    explicit GetNotificationsJob(const QString& from = {},
                                 Omittable<int> limit = none,
                                 const QString& only = {});

    /*! Construct a URL without creating a full-fledged job object
     *
     * 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 = {},
                               Omittable<int> limit = none,
                               const QString& only = {});

    ~GetNotificationsJob() override;

    // Result properties

    /// The token to supply in the ``from`` param of the next
    /// ``/notifications`` request in order to request more
    /// events. If this is absent, there are no more results.
    const QString& nextToken() const;
    /// The list of events that triggered notifications.
    std::vector<Notification>&& notifications();

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

private:
    class Private;
    QScopedPointer<Private> d;
};

} // namespace QMatrixClient