// 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_AUTHSENTCODE
#define LQTG_TYPE_AUTHSENTCODE

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QtGlobal>
#include "authcodetype.h"
#include <QString>
#include "authsentcodetype.h"

class LIBQTELEGRAMSHARED_EXPORT AuthSentCode : public TelegramTypeObject
{
public:
    enum AuthSentCodeClassType {
        typeAuthSentCode = 0x5e002502
    };

    AuthSentCode(AuthSentCodeClassType classType = typeAuthSentCode, InboundPkt *in = 0);
    AuthSentCode(InboundPkt *in);
    AuthSentCode(const Null&);
    AuthSentCode(const AuthSentCode &another);
    virtual ~AuthSentCode();

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

    void setNextType(const AuthCodeType &nextType);
    AuthCodeType nextType() const;

    void setPhoneCodeHash(const QString &phoneCodeHash);
    QString phoneCodeHash() const;

    void setPhoneRegistered(bool phoneRegistered);
    bool phoneRegistered() const;

    void setTimeout(qint32 timeout);
    qint32 timeout() const;

    void setType(const AuthSentCodeType &type);
    AuthSentCodeType type() const;

    void setClassType(AuthSentCodeClassType classType);
    AuthSentCodeClassType classType() const;

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

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

    bool operator ==(const AuthSentCode &b) const;
    AuthSentCode &operator =(const AuthSentCode &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;
    AuthCodeType m_nextType;
    QString m_phoneCodeHash;
    qint32 m_timeout;
    AuthSentCodeType m_type;
    AuthSentCodeClassType m_classType;
};

Q_DECLARE_METATYPE(AuthSentCode)

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

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

#endif // LQTG_TYPE_AUTHSENTCODE
