// 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_WEBDOCUMENT
#define LQTG_TYPE_WEBDOCUMENT

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QtGlobal>
#include <QList>
#include "documentattribute.h"
#include <QString>

class LIBQTELEGRAMSHARED_EXPORT WebDocument : public TelegramTypeObject
{
public:
    enum WebDocumentClassType {
        typeWebDocument = 0xc61acbd8
    };

    WebDocument(WebDocumentClassType classType = typeWebDocument, InboundPkt *in = 0);
    WebDocument(InboundPkt *in);
    WebDocument(const Null&);
    WebDocument(const WebDocument &another);
    virtual ~WebDocument();

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

    void setAttributes(const QList<DocumentAttribute> &attributes);
    QList<DocumentAttribute> attributes() const;

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

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

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

    void setUrl(const QString &url);
    QString url() const;

    void setClassType(WebDocumentClassType classType);
    WebDocumentClassType classType() const;

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

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

    bool operator ==(const WebDocument &b) const;
    WebDocument &operator =(const WebDocument &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;
    QList<DocumentAttribute> m_attributes;
    qint32 m_dcId;
    QString m_mimeType;
    qint32 m_size;
    QString m_url;
    WebDocumentClassType m_classType;
};

Q_DECLARE_METATYPE(WebDocument)

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

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

#endif // LQTG_TYPE_WEBDOCUMENT
