// 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_INPUTCHANNEL
#define LQTG_TYPE_INPUTCHANNEL

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QtGlobal>

class LIBQTELEGRAMSHARED_EXPORT InputChannel : public TelegramTypeObject
{
public:
    enum InputChannelClassType {
        typeInputChannelEmpty = 0xee8c1e86,
        typeInputChannel = 0xafeb712e
    };

    InputChannel(InputChannelClassType classType = typeInputChannelEmpty, InboundPkt *in = 0);
    InputChannel(InboundPkt *in);
    InputChannel(const Null&);
    InputChannel(const InputChannel &another);
    virtual ~InputChannel();

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

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

    void setClassType(InputChannelClassType classType);
    InputChannelClassType classType() const;

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

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

    bool operator ==(const InputChannel &b) const;
    InputChannel &operator =(const InputChannel &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;
    InputChannelClassType m_classType;
};

Q_DECLARE_METATYPE(InputChannel)

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

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

#endif // LQTG_TYPE_INPUTCHANNEL
