// This file generated by libqtelegram-code-generator.
// You can download it from: https://github.com/Aseman-Land/libqtelegram-code-generator
// DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

#ifndef LQTG_TYPE_CHANNELMESSAGESFILTER
#define LQTG_TYPE_CHANNELMESSAGESFILTER

#include "telegramtypeobject.h"

#include <QMetaType>
#include <QVariant>
#include "../coretypes.h"

#include <QDataStream>

#include <QtGlobal>
#include <QList>
#include "messagerange.h"

class LIBQTELEGRAMSHARED_EXPORT ChannelMessagesFilter : public TelegramTypeObject
{
public:
    enum ChannelMessagesFilterClassType {
        typeChannelMessagesFilterEmpty = 0x94d42ee7,
        typeChannelMessagesFilter = 0xcd77d957
    };

    ChannelMessagesFilter(ChannelMessagesFilterClassType classType = typeChannelMessagesFilterEmpty, InboundPkt *in = 0);
    ChannelMessagesFilter(InboundPkt *in);
    ChannelMessagesFilter(const Null&);
    ChannelMessagesFilter(const ChannelMessagesFilter &another);
    virtual ~ChannelMessagesFilter();

    void setExcludeNewMessages(bool excludeNewMessages);
    bool excludeNewMessages() const;

    void setFlags(qint32 flags);
    qint32 flags() const;

    void setRanges(const QList<MessageRange> &ranges);
    QList<MessageRange> ranges() const;

    void setClassType(ChannelMessagesFilterClassType classType);
    ChannelMessagesFilterClassType classType() const;

    bool fetch(InboundPkt *in);
    bool push(OutboundPkt *out) const;

    QMap<QString, QVariant> toMap() const;
    static ChannelMessagesFilter fromMap(const QMap<QString, QVariant> &map);
    static ChannelMessagesFilter fromJson(const QString &json);

    bool operator ==(const ChannelMessagesFilter &b) const;
    ChannelMessagesFilter &operator =(const ChannelMessagesFilter &b);

    bool operator==(bool stt) const { return isNull() != stt; }
    bool operator!=(bool stt) const { return !operator ==(stt); }

    QByteArray getHash(QCryptographicHash::Algorithm alg = QCryptographicHash::Md5) const;

private:
    qint32 m_flags;
    QList<MessageRange> m_ranges;
    ChannelMessagesFilterClassType m_classType;
};

Q_DECLARE_METATYPE(ChannelMessagesFilter)

QDataStream LIBQTELEGRAMSHARED_EXPORT &operator<<(QDataStream &stream, const ChannelMessagesFilter &item);
QDataStream LIBQTELEGRAMSHARED_EXPORT &operator>>(QDataStream &stream, ChannelMessagesFilter &item);

QDebug LIBQTELEGRAMSHARED_EXPORT operator<<(QDebug debug,  const ChannelMessagesFilter &item);

#endif // LQTG_TYPE_CHANNELMESSAGESFILTER
