// 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_DECRYPTEDMESSAGELAYER
#define LQTG_TYPE_DECRYPTEDMESSAGELAYER

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QtGlobal>
#include "decryptedmessage.h"
#include <QByteArray>

class LIBQTELEGRAMSHARED_EXPORT DecryptedMessageLayer : public TelegramTypeObject
{
public:
    enum DecryptedMessageLayerClassType {
        typeDecryptedMessageLayerSecret17 = 0x1be31789
    };

    DecryptedMessageLayer(DecryptedMessageLayerClassType classType = typeDecryptedMessageLayerSecret17, InboundPkt *in = 0);
    DecryptedMessageLayer(InboundPkt *in);
    DecryptedMessageLayer(const Null&);
    DecryptedMessageLayer(const DecryptedMessageLayer &another);
    virtual ~DecryptedMessageLayer();

    void setInSeqNo(qint32 inSeqNo);
    qint32 inSeqNo() const;

    void setLayer(qint32 layer);
    qint32 layer() const;

    void setMessage(const DecryptedMessage &message);
    DecryptedMessage message() const;

    void setOutSeqNo(qint32 outSeqNo);
    qint32 outSeqNo() const;

    void setRandomBytes(const QByteArray &randomBytes);
    QByteArray randomBytes() const;

    void setClassType(DecryptedMessageLayerClassType classType);
    DecryptedMessageLayerClassType classType() const;

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

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

    bool operator ==(const DecryptedMessageLayer &b) const;
    DecryptedMessageLayer &operator =(const DecryptedMessageLayer &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_inSeqNo;
    qint32 m_layer;
    DecryptedMessage m_message;
    qint32 m_outSeqNo;
    QByteArray m_randomBytes;
    DecryptedMessageLayerClassType m_classType;
};

Q_DECLARE_METATYPE(DecryptedMessageLayer)

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

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

#endif // LQTG_TYPE_DECRYPTEDMESSAGELAYER
