// 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_UPLOADWEBFILE
#define LQTG_TYPE_UPLOADWEBFILE

#include "telegramtypeobject.h"

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

#include <QDataStream>

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

class LIBQTELEGRAMSHARED_EXPORT UploadWebFile : public TelegramTypeObject
{
public:
    enum UploadWebFileClassType {
        typeUploadWebFile = 0x21e753bc
    };

    UploadWebFile(UploadWebFileClassType classType = typeUploadWebFile, InboundPkt *in = 0);
    UploadWebFile(InboundPkt *in);
    UploadWebFile(const Null&);
    UploadWebFile(const UploadWebFile &another);
    virtual ~UploadWebFile();

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

    void setFileType(const StorageFileType &fileType);
    StorageFileType fileType() const;

    void setMimeType(const QString &mimeType);
    QString mimeType() const;

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

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

    void setClassType(UploadWebFileClassType classType);
    UploadWebFileClassType classType() const;

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

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

    bool operator ==(const UploadWebFile &b) const;
    UploadWebFile &operator =(const UploadWebFile &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;
    StorageFileType m_fileType;
    QString m_mimeType;
    qint32 m_mtime;
    qint32 m_size;
    UploadWebFileClassType m_classType;
};

Q_DECLARE_METATYPE(UploadWebFile)

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

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

#endif // LQTG_TYPE_UPLOADWEBFILE
