// 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_BOT_TYPE_BOTMESSAGEENTITY
#define LQTG_BOT_TYPE_BOTMESSAGEENTITY

#include "telegrambottypeobject.h"

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

#include <QDataStream>
#include <QDebug>

#include <QtGlobal>
#include <QString>
#include "botuser.h"

class LIBQTELEGRAMSHARED_EXPORT BotMessageEntity : public TelegramBotTypeObject
{
public:
    enum BotMessageEntityClassType {
        typeTypeMessageEntity = 0xffa800
    };

    BotMessageEntity(const QMap<QString, QVariant> &map);
    BotMessageEntity(const Null &_null = TelegramBotTypeObject::null);
    BotMessageEntity(const BotMessageEntity &another);
    virtual ~BotMessageEntity();

    void setLength(qint32 length);
    qint32 length() const;

    void setOffset(qint32 offset);
    qint32 offset() const;

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

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

    void setUser(const BotUser &user);
    BotUser user() const;

    void setClassType(BotMessageEntityClassType classType);
    BotMessageEntityClassType classType() const;

    QMap<QString, QVariant> toMap() const;
    void fromMap(const QMap<QString, QVariant> &map);
    bool operator ==(const BotMessageEntity &b) const;
    BotMessageEntity &operator =(const BotMessageEntity &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:
    qint32 m_length;
    qint32 m_offset;
    QString m_type;
    QString m_url;
    BotUser m_user;
    BotMessageEntityClassType m_classType;
};

Q_DECLARE_METATYPE(BotMessageEntity)

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

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

#endif // LQTG_BOT_TYPE_BOTMESSAGEENTITY
