// 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_PEERSETTINGS
#define LQTG_TYPE_PEERSETTINGS

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QtGlobal>

class LIBQTELEGRAMSHARED_EXPORT PeerSettings : public TelegramTypeObject
{
public:
    enum PeerSettingsClassType {
        typePeerSettings = 0x818426cd
    };

    PeerSettings(PeerSettingsClassType classType = typePeerSettings, InboundPkt *in = 0);
    PeerSettings(InboundPkt *in);
    PeerSettings(const Null&);
    PeerSettings(const PeerSettings &another);
    virtual ~PeerSettings();

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

    void setReportSpam(bool reportSpam);
    bool reportSpam() const;

    void setClassType(PeerSettingsClassType classType);
    PeerSettingsClassType classType() const;

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

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

    bool operator ==(const PeerSettings &b) const;
    PeerSettings &operator =(const PeerSettings &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;
    PeerSettingsClassType m_classType;
};

Q_DECLARE_METATYPE(PeerSettings)

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

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

#endif // LQTG_TYPE_PEERSETTINGS
