// 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_MESSAGERANGE
#define LQTG_TYPE_MESSAGERANGE

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QtGlobal>

class LIBQTELEGRAMSHARED_EXPORT MessageRange : public TelegramTypeObject
{
public:
    enum MessageRangeClassType {
        typeMessageRange = 0xae30253
    };

    MessageRange(MessageRangeClassType classType = typeMessageRange, InboundPkt *in = 0);
    MessageRange(InboundPkt *in);
    MessageRange(const Null&);
    MessageRange(const MessageRange &another);
    virtual ~MessageRange();

    void setMaxId(qint32 maxId);
    qint32 maxId() const;

    void setMinId(qint32 minId);
    qint32 minId() const;

    void setClassType(MessageRangeClassType classType);
    MessageRangeClassType classType() const;

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

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

    bool operator ==(const MessageRange &b) const;
    MessageRange &operator =(const MessageRange &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_maxId;
    qint32 m_minId;
    MessageRangeClassType m_classType;
};

Q_DECLARE_METATYPE(MessageRange)

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

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

#endif // LQTG_TYPE_MESSAGERANGE
