// 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_CONTACTSRESOLVEDPEER
#define LQTG_TYPE_CONTACTSRESOLVEDPEER

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QList>
#include "chat.h"
#include "peer.h"
#include "user.h"

class LIBQTELEGRAMSHARED_EXPORT ContactsResolvedPeer : public TelegramTypeObject
{
public:
    enum ContactsResolvedPeerClassType {
        typeContactsResolvedPeer = 0x7f077ad9
    };

    ContactsResolvedPeer(ContactsResolvedPeerClassType classType = typeContactsResolvedPeer, InboundPkt *in = 0);
    ContactsResolvedPeer(InboundPkt *in);
    ContactsResolvedPeer(const Null&);
    ContactsResolvedPeer(const ContactsResolvedPeer &another);
    virtual ~ContactsResolvedPeer();

    void setChats(const QList<Chat> &chats);
    QList<Chat> chats() const;

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

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

    void setClassType(ContactsResolvedPeerClassType classType);
    ContactsResolvedPeerClassType classType() const;

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

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

    bool operator ==(const ContactsResolvedPeer &b) const;
    ContactsResolvedPeer &operator =(const ContactsResolvedPeer &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<Chat> m_chats;
    Peer m_peer;
    QList<User> m_users;
    ContactsResolvedPeerClassType m_classType;
};

Q_DECLARE_METATYPE(ContactsResolvedPeer)

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

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

#endif // LQTG_TYPE_CONTACTSRESOLVEDPEER
