// 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_PRIVACYRULE
#define LQTG_TYPE_PRIVACYRULE

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QList>
#include <QtGlobal>

class LIBQTELEGRAMSHARED_EXPORT PrivacyRule : public TelegramTypeObject
{
public:
    enum PrivacyRuleClassType {
        typePrivacyValueAllowContacts = 0xfffe1bac,
        typePrivacyValueAllowAll = 0x65427b82,
        typePrivacyValueAllowUsers = 0x4d5bbe0c,
        typePrivacyValueDisallowContacts = 0xf888fa1a,
        typePrivacyValueDisallowAll = 0x8b73e763,
        typePrivacyValueDisallowUsers = 0xc7f49b7
    };

    PrivacyRule(PrivacyRuleClassType classType = typePrivacyValueAllowContacts, InboundPkt *in = 0);
    PrivacyRule(InboundPkt *in);
    PrivacyRule(const Null&);
    PrivacyRule(const PrivacyRule &another);
    virtual ~PrivacyRule();

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

    void setClassType(PrivacyRuleClassType classType);
    PrivacyRuleClassType classType() const;

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

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

    bool operator ==(const PrivacyRule &b) const;
    PrivacyRule &operator =(const PrivacyRule &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<qint32> m_users;
    PrivacyRuleClassType m_classType;
};

Q_DECLARE_METATYPE(PrivacyRule)

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

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

#endif // LQTG_TYPE_PRIVACYRULE
