// 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_AUTHSENTCODETYPE
#define LQTG_TYPE_AUTHSENTCODETYPE

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QtGlobal>
#include <QString>

class LIBQTELEGRAMSHARED_EXPORT AuthSentCodeType : public TelegramTypeObject
{
public:
    enum AuthSentCodeTypeClassType {
        typeAuthSentCodeTypeApp = 0x3dbb5986,
        typeAuthSentCodeTypeSms = 0xc000bba2,
        typeAuthSentCodeTypeCall = 0x5353e5a7,
        typeAuthSentCodeTypeFlashCall = 0xab03c6d9
    };

    AuthSentCodeType(AuthSentCodeTypeClassType classType = typeAuthSentCodeTypeApp, InboundPkt *in = 0);
    AuthSentCodeType(InboundPkt *in);
    AuthSentCodeType(const Null&);
    AuthSentCodeType(const AuthSentCodeType &another);
    virtual ~AuthSentCodeType();

    void setLength(qint32 length);
    qint32 length() const;

    void setPattern(const QString &pattern);
    QString pattern() const;

    void setClassType(AuthSentCodeTypeClassType classType);
    AuthSentCodeTypeClassType classType() const;

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

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

    bool operator ==(const AuthSentCodeType &b) const;
    AuthSentCodeType &operator =(const AuthSentCodeType &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_length;
    QString m_pattern;
    AuthSentCodeTypeClassType m_classType;
};

Q_DECLARE_METATYPE(AuthSentCodeType)

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

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

#endif // LQTG_TYPE_AUTHSENTCODETYPE
