// 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_INPUTPRIVACYRULE
#define LQTG_TYPE_INPUTPRIVACYRULE

#include "telegramtypeobject.h"

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

#include <QDataStream>

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

class LIBQTELEGRAMSHARED_EXPORT InputPrivacyRule : public TelegramTypeObject
{
public:
    enum InputPrivacyRuleClassType {
        typeInputPrivacyValueAllowContacts = 0xd09e07b,
        typeInputPrivacyValueAllowAll = 0x184b35ce,
        typeInputPrivacyValueAllowUsers = 0x131cc67f,
        typeInputPrivacyValueDisallowContacts = 0xba52007,
        typeInputPrivacyValueDisallowAll = 0xd66b66c9,
        typeInputPrivacyValueDisallowUsers = 0x90110467
    };

    InputPrivacyRule(InputPrivacyRuleClassType classType = typeInputPrivacyValueAllowContacts, InboundPkt *in = 0);
    InputPrivacyRule(InboundPkt *in);
    InputPrivacyRule(const Null&);
    InputPrivacyRule(const InputPrivacyRule &another);
    virtual ~InputPrivacyRule();

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

    void setClassType(InputPrivacyRuleClassType classType);
    InputPrivacyRuleClassType classType() const;

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

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

    bool operator ==(const InputPrivacyRule &b) const;
    InputPrivacyRule &operator =(const InputPrivacyRule &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<InputUser> m_users;
    InputPrivacyRuleClassType m_classType;
};

Q_DECLARE_METATYPE(InputPrivacyRule)

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

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

#endif // LQTG_TYPE_INPUTPRIVACYRULE
