// 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_ENCRYPTEDFILE
#define LQTG_TYPE_ENCRYPTEDFILE

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QtGlobal>

class LIBQTELEGRAMSHARED_EXPORT EncryptedFile : public TelegramTypeObject
{
public:
    enum EncryptedFileClassType {
        typeEncryptedFileEmpty = 0xc21f497e,
        typeEncryptedFile = 0x4a70994c
    };

    EncryptedFile(EncryptedFileClassType classType = typeEncryptedFileEmpty, InboundPkt *in = 0);
    EncryptedFile(InboundPkt *in);
    EncryptedFile(const Null&);
    EncryptedFile(const EncryptedFile &another);
    virtual ~EncryptedFile();

    void setAccessHash(qint64 accessHash);
    qint64 accessHash() const;

    void setDcId(qint32 dcId);
    qint32 dcId() const;

    void setId(qint64 id);
    qint64 id() const;

    void setKeyFingerprint(qint32 keyFingerprint);
    qint32 keyFingerprint() const;

    void setSize(qint32 size);
    qint32 size() const;

    void setClassType(EncryptedFileClassType classType);
    EncryptedFileClassType classType() const;

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

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

    bool operator ==(const EncryptedFile &b) const;
    EncryptedFile &operator =(const EncryptedFile &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:
    qint64 m_accessHash;
    qint32 m_dcId;
    qint64 m_id;
    qint32 m_keyFingerprint;
    qint32 m_size;
    EncryptedFileClassType m_classType;
};

Q_DECLARE_METATYPE(EncryptedFile)

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

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

#endif // LQTG_TYPE_ENCRYPTEDFILE
