// 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_ACCOUNTPASSWORD
#define LQTG_TYPE_ACCOUNTPASSWORD

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QByteArray>
#include <QString>

class LIBQTELEGRAMSHARED_EXPORT AccountPassword : public TelegramTypeObject
{
public:
    enum AccountPasswordClassType {
        typeAccountNoPassword = 0x96dabc18,
        typeAccountPassword = 0x7c18141c
    };

    AccountPassword(AccountPasswordClassType classType = typeAccountNoPassword, InboundPkt *in = 0);
    AccountPassword(InboundPkt *in);
    AccountPassword(const Null&);
    AccountPassword(const AccountPassword &another);
    virtual ~AccountPassword();

    void setCurrentSalt(const QByteArray &currentSalt);
    QByteArray currentSalt() const;

    void setEmailUnconfirmedPattern(const QString &emailUnconfirmedPattern);
    QString emailUnconfirmedPattern() const;

    void setHasRecovery(bool hasRecovery);
    bool hasRecovery() const;

    void setHint(const QString &hint);
    QString hint() const;

    void setNewSalt(const QByteArray &newSalt);
    QByteArray newSalt() const;

    void setClassType(AccountPasswordClassType classType);
    AccountPasswordClassType classType() const;

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

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

    bool operator ==(const AccountPassword &b) const;
    AccountPassword &operator =(const AccountPassword &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:
    QByteArray m_currentSalt;
    QString m_emailUnconfirmedPattern;
    bool m_hasRecovery;
    QString m_hint;
    QByteArray m_newSalt;
    AccountPasswordClassType m_classType;
};

Q_DECLARE_METATYPE(AccountPassword)

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

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

#endif // LQTG_TYPE_ACCOUNTPASSWORD
