// 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_AUTHAUTHORIZATION
#define LQTG_TYPE_AUTHAUTHORIZATION

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QtGlobal>
#include "user.h"

class LIBQTELEGRAMSHARED_EXPORT AuthAuthorization : public TelegramTypeObject
{
public:
    enum AuthAuthorizationClassType {
        typeAuthAuthorization = 0xcd050916
    };

    AuthAuthorization(AuthAuthorizationClassType classType = typeAuthAuthorization, InboundPkt *in = 0);
    AuthAuthorization(InboundPkt *in);
    AuthAuthorization(const Null&);
    AuthAuthorization(const AuthAuthorization &another);
    virtual ~AuthAuthorization();

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

    void setTmpSessions(qint32 tmpSessions);
    qint32 tmpSessions() const;

    void setUser(const User &user);
    User user() const;

    void setClassType(AuthAuthorizationClassType classType);
    AuthAuthorizationClassType classType() const;

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

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

    bool operator ==(const AuthAuthorization &b) const;
    AuthAuthorization &operator =(const AuthAuthorization &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;
    qint32 m_tmpSessions;
    User m_user;
    AuthAuthorizationClassType m_classType;
};

Q_DECLARE_METATYPE(AuthAuthorization)

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

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

#endif // LQTG_TYPE_AUTHAUTHORIZATION
