// 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_CONTACTSTATUS
#define LQTG_TYPE_CONTACTSTATUS

#include "telegramtypeobject.h"

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

#include <QDataStream>

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

class LIBQTELEGRAMSHARED_EXPORT ContactStatus : public TelegramTypeObject
{
public:
    enum ContactStatusClassType {
        typeContactStatus = 0xd3680c61
    };

    ContactStatus(ContactStatusClassType classType = typeContactStatus, InboundPkt *in = 0);
    ContactStatus(InboundPkt *in);
    ContactStatus(const Null&);
    ContactStatus(const ContactStatus &another);
    virtual ~ContactStatus();

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

    void setUserId(qint32 userId);
    qint32 userId() const;

    void setClassType(ContactStatusClassType classType);
    ContactStatusClassType classType() const;

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

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

    bool operator ==(const ContactStatus &b) const;
    ContactStatus &operator =(const ContactStatus &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:
    UserStatus m_status;
    qint32 m_userId;
    ContactStatusClassType m_classType;
};

Q_DECLARE_METATYPE(ContactStatus)

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

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

#endif // LQTG_TYPE_CONTACTSTATUS
