// 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_INPUTPEER
#define LQTG_TYPE_INPUTPEER

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QtGlobal>

class LIBQTELEGRAMSHARED_EXPORT InputPeer : public TelegramTypeObject
{
public:
    enum InputPeerClassType {
        typeInputPeerEmpty = 0x7f3b18ea,
        typeInputPeerSelf = 0x7da07ec9,
        typeInputPeerChat = 0x179be863,
        typeInputPeerUser = 0x7b8e7de6,
        typeInputPeerChannel = 0x20adaef8
    };

    InputPeer(InputPeerClassType classType = typeInputPeerEmpty, InboundPkt *in = 0);
    InputPeer(InboundPkt *in);
    InputPeer(const Null&);
    InputPeer(const InputPeer &another);
    virtual ~InputPeer();

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

    void setChannelId(qint32 channelId);
    qint32 channelId() const;

    void setChatId(qint32 chatId);
    qint32 chatId() const;

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

    void setClassType(InputPeerClassType classType);
    InputPeerClassType classType() const;

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

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

    bool operator ==(const InputPeer &b) const;
    InputPeer &operator =(const InputPeer &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_channelId;
    qint32 m_chatId;
    qint32 m_userId;
    InputPeerClassType m_classType;
};

Q_DECLARE_METATYPE(InputPeer)

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

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

#endif // LQTG_TYPE_INPUTPEER
