// 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_UPLOADFILE
#define LQTG_TYPE_UPLOADFILE

#include "telegramtypeobject.h"

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

#include <QDataStream>

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

class LIBQTELEGRAMSHARED_EXPORT UploadFile : public TelegramTypeObject
{
public:
    enum UploadFileClassType {
        typeUploadFile = 0x96a18d5,
        typeUploadFileCdnRedirect = 0x1508485a
    };

    UploadFile(UploadFileClassType classType = typeUploadFile, InboundPkt *in = 0);
    UploadFile(InboundPkt *in);
    UploadFile(const Null&);
    UploadFile(const UploadFile &another);
    virtual ~UploadFile();

    void setBytes(const QByteArray &bytes);
    QByteArray bytes() const;

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

    void setEncryptionIv(const QByteArray &encryptionIv);
    QByteArray encryptionIv() const;

    void setEncryptionKey(const QByteArray &encryptionKey);
    QByteArray encryptionKey() const;

    void setFileToken(const QByteArray &fileToken);
    QByteArray fileToken() const;

    void setMtime(qint32 mtime);
    qint32 mtime() const;

    void setType(const StorageFileType &type);
    StorageFileType type() const;

    void setClassType(UploadFileClassType classType);
    UploadFileClassType classType() const;

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

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

    bool operator ==(const UploadFile &b) const;
    UploadFile &operator =(const UploadFile &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:
    QByteArray m_bytes;
    qint32 m_dcId;
    QByteArray m_encryptionIv;
    QByteArray m_encryptionKey;
    QByteArray m_fileToken;
    qint32 m_mtime;
    StorageFileType m_type;
    UploadFileClassType m_classType;
};

Q_DECLARE_METATYPE(UploadFile)

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

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

#endif // LQTG_TYPE_UPLOADFILE
