// 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_CHATINVITE
#define LQTG_TYPE_CHATINVITE

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include "chat.h"
#include <QtGlobal>
#include <QList>
#include "user.h"
#include "chatphoto.h"
#include <QString>

class LIBQTELEGRAMSHARED_EXPORT ChatInvite : public TelegramTypeObject
{
public:
    enum ChatInviteClassType {
        typeChatInviteAlready = 0x5a686d7c,
        typeChatInvite = 0xdb74f558
    };

    ChatInvite(ChatInviteClassType classType = typeChatInviteAlready, InboundPkt *in = 0);
    ChatInvite(InboundPkt *in);
    ChatInvite(const Null&);
    ChatInvite(const ChatInvite &another);
    virtual ~ChatInvite();

    void setBroadcast(bool broadcast);
    bool broadcast() const;

    void setChannel(bool channel);
    bool channel() const;

    void setChat(const Chat &chat);
    Chat chat() const;

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

    void setMegagroup(bool megagroup);
    bool megagroup() const;

    void setParticipants(const QList<User> &participants);
    QList<User> participants() const;

    void setParticipantsCount(qint32 participantsCount);
    qint32 participantsCount() const;

    void setPhoto(const ChatPhoto &photo);
    ChatPhoto photo() const;

    void setPublicValue(bool publicValue);
    bool publicValue() const;

    void setTitle(const QString &title);
    QString title() const;

    void setClassType(ChatInviteClassType classType);
    ChatInviteClassType classType() const;

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

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

    bool operator ==(const ChatInvite &b) const;
    ChatInvite &operator =(const ChatInvite &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:
    Chat m_chat;
    qint32 m_flags;
    QList<User> m_participants;
    qint32 m_participantsCount;
    ChatPhoto m_photo;
    QString m_title;
    ChatInviteClassType m_classType;
};

Q_DECLARE_METATYPE(ChatInvite)

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

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

#endif // LQTG_TYPE_CHATINVITE
