// 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_TOPPEER
#define LQTG_TYPE_TOPPEER

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include "peer.h"
#include <QtGlobal>

class LIBQTELEGRAMSHARED_EXPORT TopPeer : public TelegramTypeObject
{
public:
    enum TopPeerClassType {
        typeTopPeer = 0xedcdc05b
    };

    TopPeer(TopPeerClassType classType = typeTopPeer, InboundPkt *in = 0);
    TopPeer(InboundPkt *in);
    TopPeer(const Null&);
    TopPeer(const TopPeer &another);
    virtual ~TopPeer();

    void setPeer(const Peer &peer);
    Peer peer() const;

    void setRating(qreal rating);
    qreal rating() const;

    void setClassType(TopPeerClassType classType);
    TopPeerClassType classType() const;

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

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

    bool operator ==(const TopPeer &b) const;
    TopPeer &operator =(const TopPeer &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:
    Peer m_peer;
    qreal m_rating;
    TopPeerClassType m_classType;
};

Q_DECLARE_METATYPE(TopPeer)

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

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

#endif // LQTG_TYPE_TOPPEER
