// 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_PHONECALLDISCARDREASON
#define LQTG_TYPE_PHONECALLDISCARDREASON

#include "telegramtypeobject.h"

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

#include <QDataStream>


class LIBQTELEGRAMSHARED_EXPORT PhoneCallDiscardReason : public TelegramTypeObject
{
public:
    enum PhoneCallDiscardReasonClassType {
        typePhoneCallDiscardReasonMissed = 0x85e42301,
        typePhoneCallDiscardReasonDisconnect = 0xe095c1a0,
        typePhoneCallDiscardReasonHangup = 0x57adc690,
        typePhoneCallDiscardReasonBusy = 0xfaf7e8c9
    };

    PhoneCallDiscardReason(PhoneCallDiscardReasonClassType classType = typePhoneCallDiscardReasonMissed, InboundPkt *in = 0);
    PhoneCallDiscardReason(InboundPkt *in);
    PhoneCallDiscardReason(const Null&);
    PhoneCallDiscardReason(const PhoneCallDiscardReason &another);
    virtual ~PhoneCallDiscardReason();

    void setClassType(PhoneCallDiscardReasonClassType classType);
    PhoneCallDiscardReasonClassType classType() const;

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

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

    bool operator ==(const PhoneCallDiscardReason &b) const;
    PhoneCallDiscardReason &operator =(const PhoneCallDiscardReason &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:
    PhoneCallDiscardReasonClassType m_classType;
};

Q_DECLARE_METATYPE(PhoneCallDiscardReason)

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

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

#endif // LQTG_TYPE_PHONECALLDISCARDREASON
