// 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_PHONECALLPROTOCOL
#define LQTG_TYPE_PHONECALLPROTOCOL

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QtGlobal>

class LIBQTELEGRAMSHARED_EXPORT PhoneCallProtocol : public TelegramTypeObject
{
public:
    enum PhoneCallProtocolClassType {
        typePhoneCallProtocol = 0xa2bb35cb
    };

    PhoneCallProtocol(PhoneCallProtocolClassType classType = typePhoneCallProtocol, InboundPkt *in = 0);
    PhoneCallProtocol(InboundPkt *in);
    PhoneCallProtocol(const Null&);
    PhoneCallProtocol(const PhoneCallProtocol &another);
    virtual ~PhoneCallProtocol();

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

    void setMaxLayer(qint32 maxLayer);
    qint32 maxLayer() const;

    void setMinLayer(qint32 minLayer);
    qint32 minLayer() const;

    void setUdpP2p(bool udpP2p);
    bool udpP2p() const;

    void setUdpReflector(bool udpReflector);
    bool udpReflector() const;

    void setClassType(PhoneCallProtocolClassType classType);
    PhoneCallProtocolClassType classType() const;

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

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

    bool operator ==(const PhoneCallProtocol &b) const;
    PhoneCallProtocol &operator =(const PhoneCallProtocol &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_flags;
    qint32 m_maxLayer;
    qint32 m_minLayer;
    PhoneCallProtocolClassType m_classType;
};

Q_DECLARE_METATYPE(PhoneCallProtocol)

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

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

#endif // LQTG_TYPE_PHONECALLPROTOCOL
