// 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_ACCOUNTPRIVACYRULES
#define LQTG_TYPE_ACCOUNTPRIVACYRULES

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QList>
#include "privacyrule.h"
#include "user.h"

class LIBQTELEGRAMSHARED_EXPORT AccountPrivacyRules : public TelegramTypeObject
{
public:
    enum AccountPrivacyRulesClassType {
        typeAccountPrivacyRules = 0x554abb6f
    };

    AccountPrivacyRules(AccountPrivacyRulesClassType classType = typeAccountPrivacyRules, InboundPkt *in = 0);
    AccountPrivacyRules(InboundPkt *in);
    AccountPrivacyRules(const Null&);
    AccountPrivacyRules(const AccountPrivacyRules &another);
    virtual ~AccountPrivacyRules();

    void setRules(const QList<PrivacyRule> &rules);
    QList<PrivacyRule> rules() const;

    void setUsers(const QList<User> &users);
    QList<User> users() const;

    void setClassType(AccountPrivacyRulesClassType classType);
    AccountPrivacyRulesClassType classType() const;

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

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

    bool operator ==(const AccountPrivacyRules &b) const;
    AccountPrivacyRules &operator =(const AccountPrivacyRules &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<PrivacyRule> m_rules;
    QList<User> m_users;
    AccountPrivacyRulesClassType m_classType;
};

Q_DECLARE_METATYPE(AccountPrivacyRules)

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

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

#endif // LQTG_TYPE_ACCOUNTPRIVACYRULES
