// 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_ACCOUNTAUTHORIZATIONS
#define LQTG_TYPE_ACCOUNTAUTHORIZATIONS

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QList>
#include "authorization.h"

class LIBQTELEGRAMSHARED_EXPORT AccountAuthorizations : public TelegramTypeObject
{
public:
    enum AccountAuthorizationsClassType {
        typeAccountAuthorizations = 0x1250abde
    };

    AccountAuthorizations(AccountAuthorizationsClassType classType = typeAccountAuthorizations, InboundPkt *in = 0);
    AccountAuthorizations(InboundPkt *in);
    AccountAuthorizations(const Null&);
    AccountAuthorizations(const AccountAuthorizations &another);
    virtual ~AccountAuthorizations();

    void setAuthorizations(const QList<Authorization> &authorizations);
    QList<Authorization> authorizations() const;

    void setClassType(AccountAuthorizationsClassType classType);
    AccountAuthorizationsClassType classType() const;

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

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

    bool operator ==(const AccountAuthorizations &b) const;
    AccountAuthorizations &operator =(const AccountAuthorizations &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:
    QList<Authorization> m_authorizations;
    AccountAuthorizationsClassType m_classType;
};

Q_DECLARE_METATYPE(AccountAuthorizations)

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

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

#endif // LQTG_TYPE_ACCOUNTAUTHORIZATIONS
