// 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_ACCOUNTTMPPASSWORD
#define LQTG_TYPE_ACCOUNTTMPPASSWORD

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QByteArray>
#include <QtGlobal>

class LIBQTELEGRAMSHARED_EXPORT AccountTmpPassword : public TelegramTypeObject
{
public:
    enum AccountTmpPasswordClassType {
        typeAccountTmpPassword = 0xdb64fd34
    };

    AccountTmpPassword(AccountTmpPasswordClassType classType = typeAccountTmpPassword, InboundPkt *in = 0);
    AccountTmpPassword(InboundPkt *in);
    AccountTmpPassword(const Null&);
    AccountTmpPassword(const AccountTmpPassword &another);
    virtual ~AccountTmpPassword();

    void setTmpPassword(const QByteArray &tmpPassword);
    QByteArray tmpPassword() const;

    void setValidUntil(qint32 validUntil);
    qint32 validUntil() const;

    void setClassType(AccountTmpPasswordClassType classType);
    AccountTmpPasswordClassType classType() const;

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

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

    bool operator ==(const AccountTmpPassword &b) const;
    AccountTmpPassword &operator =(const AccountTmpPassword &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_tmpPassword;
    qint32 m_validUntil;
    AccountTmpPasswordClassType m_classType;
};

Q_DECLARE_METATYPE(AccountTmpPassword)

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

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

#endif // LQTG_TYPE_ACCOUNTTMPPASSWORD
