// 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_USER
#define LQTG_TYPE_USER

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QtGlobal>
#include <QString>
#include "userprofilephoto.h"
#include "userstatus.h"

class LIBQTELEGRAMSHARED_EXPORT User : public TelegramTypeObject
{
public:
    enum UserClassType {
        typeUserEmpty = 0x200250ba,
        typeUser = 0x2e13f4c3
    };

    User(UserClassType classType = typeUserEmpty, InboundPkt *in = 0);
    User(InboundPkt *in);
    User(const Null&);
    User(const User &another);
    virtual ~User();

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

    void setBot(bool bot);
    bool bot() const;

    void setBotChatHistory(bool botChatHistory);
    bool botChatHistory() const;

    void setBotInfoVersion(qint32 botInfoVersion);
    qint32 botInfoVersion() const;

    void setBotInlineGeo(bool botInlineGeo);
    bool botInlineGeo() const;

    void setBotInlinePlaceholder(const QString &botInlinePlaceholder);
    QString botInlinePlaceholder() const;

    void setBotNochats(bool botNochats);
    bool botNochats() const;

    void setContact(bool contact);
    bool contact() const;

    void setDeleted(bool deleted);
    bool deleted() const;

    void setFirstName(const QString &firstName);
    QString firstName() const;

    void setFlags(qint32 flags);
    qint32 flags() const;

    void setId(qint32 id);
    qint32 id() const;

    void setLangCode(const QString &langCode);
    QString langCode() const;

    void setLastName(const QString &lastName);
    QString lastName() const;

    void setMin(bool min);
    bool min() const;

    void setMutualContact(bool mutualContact);
    bool mutualContact() const;

    void setPhone(const QString &phone);
    QString phone() const;

    void setPhoto(const UserProfilePhoto &photo);
    UserProfilePhoto photo() const;

    void setRestricted(bool restricted);
    bool restricted() const;

    void setRestrictionReason(const QString &restrictionReason);
    QString restrictionReason() const;

    void setSelf(bool self);
    bool self() const;

    void setStatus(const UserStatus &status);
    UserStatus status() const;

    void setUsername(const QString &username);
    QString username() const;

    void setVerified(bool verified);
    bool verified() const;

    void setClassType(UserClassType classType);
    UserClassType classType() const;

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

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

    bool operator ==(const User &b) const;
    User &operator =(const User &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_botInfoVersion;
    QString m_botInlinePlaceholder;
    QString m_firstName;
    qint32 m_flags;
    qint32 m_id;
    QString m_langCode;
    QString m_lastName;
    QString m_phone;
    UserProfilePhoto m_photo;
    QString m_restrictionReason;
    UserStatus m_status;
    QString m_username;
    UserClassType m_classType;
};

Q_DECLARE_METATYPE(User)

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

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

#endif // LQTG_TYPE_USER
