// 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_DECRYPTEDMESSAGEACTION
#define LQTG_TYPE_DECRYPTEDMESSAGEACTION

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include "sendmessageaction.h"
#include <QtGlobal>
#include <QByteArray>
#include <QList>

class LIBQTELEGRAMSHARED_EXPORT DecryptedMessageAction : public TelegramTypeObject
{
public:
    enum DecryptedMessageActionClassType {
        typeDecryptedMessageActionSetMessageTTLSecret8 = 0xa1733aec,
        typeDecryptedMessageActionReadMessagesSecret8 = 0xc4f40be,
        typeDecryptedMessageActionDeleteMessagesSecret8 = 0x65614304,
        typeDecryptedMessageActionScreenshotMessagesSecret8 = 0x8ac1f475,
        typeDecryptedMessageActionFlushHistorySecret8 = 0x6719e45c,
        typeDecryptedMessageActionResendSecret17 = 0x511110b0,
        typeDecryptedMessageActionNotifyLayerSecret17 = 0xf3048883,
        typeDecryptedMessageActionTypingSecret17 = 0xccb27641,
        typeDecryptedMessageActionRequestKeySecret20 = 0xf3c9611b,
        typeDecryptedMessageActionAcceptKeySecret20 = 0x6fe1735b,
        typeDecryptedMessageActionAbortKeySecret20 = 0xdd05ec6b,
        typeDecryptedMessageActionCommitKeySecret20 = 0xec2e0b9b,
        typeDecryptedMessageActionNoopSecret20 = 0xa82fdd63
    };

    DecryptedMessageAction(DecryptedMessageActionClassType classType = typeDecryptedMessageActionSetMessageTTLSecret8, InboundPkt *in = 0);
    DecryptedMessageAction(InboundPkt *in);
    DecryptedMessageAction(const Null&);
    DecryptedMessageAction(const DecryptedMessageAction &another);
    virtual ~DecryptedMessageAction();

    void setAction(const SendMessageAction &action);
    SendMessageAction action() const;

    void setEndSeqNo(qint32 endSeqNo);
    qint32 endSeqNo() const;

    void setExchangeId(qint64 exchangeId);
    qint64 exchangeId() const;

    void setGA(const QByteArray &gA);
    QByteArray gA() const;

    void setGB(const QByteArray &gB);
    QByteArray gB() const;

    void setKeyFingerprint(qint64 keyFingerprint);
    qint64 keyFingerprint() const;

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

    void setRandomIds(const QList<qint64> &randomIds);
    QList<qint64> randomIds() const;

    void setStartSeqNo(qint32 startSeqNo);
    qint32 startSeqNo() const;

    void setTtlSeconds(qint32 ttlSeconds);
    qint32 ttlSeconds() const;

    void setClassType(DecryptedMessageActionClassType classType);
    DecryptedMessageActionClassType classType() const;

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

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

    bool operator ==(const DecryptedMessageAction &b) const;
    DecryptedMessageAction &operator =(const DecryptedMessageAction &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:
    SendMessageAction m_action;
    qint32 m_endSeqNo;
    qint64 m_exchangeId;
    QByteArray m_gA;
    QByteArray m_gB;
    qint64 m_keyFingerprint;
    qint32 m_layer;
    QList<qint64> m_randomIds;
    qint32 m_startSeqNo;
    qint32 m_ttlSeconds;
    DecryptedMessageActionClassType m_classType;
};

Q_DECLARE_METATYPE(DecryptedMessageAction)

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

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

#endif // LQTG_TYPE_DECRYPTEDMESSAGEACTION
