// 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_UPDATE
#define LQTG_TYPE_UPDATE

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include "sendmessageaction.h"
#include <QtGlobal>
#include "encryptedchat.h"
#include <QString>
#include "datajson.h"
#include <QByteArray>
#include <QList>
#include "dcoption.h"
#include "langpackdifference.h"
#include "draftmessage.h"
#include "messageentity.h"
#include "contactlink.h"
#include "geopoint.h"
#include "paymentrequestedinfo.h"
#include "privacykey.h"
#include "messagemedia.h"
#include "encryptedmessage.h"
#include "message.h"
#include "inputbotinlinemessageid.h"
#include "peernotifysettings.h"
#include "peer.h"
#include "chatparticipants.h"
#include "notifypeer.h"
#include "phonecall.h"
#include "userprofilephoto.h"
#include "privacyrule.h"
#include "postaddress.h"
#include "userstatus.h"
#include "messagesstickerset.h"
#include "webpage.h"

class LIBQTELEGRAMSHARED_EXPORT Update : public TelegramTypeObject
{
public:
    enum UpdateClassType {
        typeUpdateNewMessage = 0x1f2b0afd,
        typeUpdateMessageID = 0x4e90bfd6,
        typeUpdateDeleteMessages = 0xa20db0e5,
        typeUpdateUserTyping = 0x5c486927,
        typeUpdateChatUserTyping = 0x9a65ea1f,
        typeUpdateChatParticipants = 0x7761198,
        typeUpdateUserStatus = 0x1bfbd823,
        typeUpdateUserName = 0xa7332b73,
        typeUpdateUserPhoto = 0x95313b0c,
        typeUpdateContactRegistered = 0x2575bbb9,
        typeUpdateContactLink = 0x9d2e67c5,
        typeUpdateNewEncryptedMessage = 0x12bcbd9a,
        typeUpdateEncryptedChatTyping = 0x1710f156,
        typeUpdateEncryption = 0xb4a2e88d,
        typeUpdateEncryptedMessagesRead = 0x38fe25b7,
        typeUpdateChatParticipantAdd = 0xea4b0e5c,
        typeUpdateChatParticipantDelete = 0x6e5f8c22,
        typeUpdateDcOptions = 0x8e5e9873,
        typeUpdateUserBlocked = 0x80ece81a,
        typeUpdateNotifySettings = 0xbec268ef,
        typeUpdateServiceNotification = 0xebe46819,
        typeUpdatePrivacy = 0xee3b272a,
        typeUpdateUserPhone = 0x12b9417b,
        typeUpdateReadHistoryInbox = 0x9961fd5c,
        typeUpdateReadHistoryOutbox = 0x2f2f21bf,
        typeUpdateWebPage = 0x7f891213,
        typeUpdateReadMessagesContents = 0x68c13933,
        typeUpdateChannelTooLong = 0xeb0467fb,
        typeUpdateChannel = 0xb6d45656,
        typeUpdateNewChannelMessage = 0x62ba04d9,
        typeUpdateReadChannelInbox = 0x4214f37f,
        typeUpdateDeleteChannelMessages = 0xc37521c9,
        typeUpdateChannelMessageViews = 0x98a12b4b,
        typeUpdateChatAdmins = 0x6e947941,
        typeUpdateChatParticipantAdmin = 0xb6901959,
        typeUpdateNewStickerSet = 0x688a30aa,
        typeUpdateStickerSetsOrder = 0xbb2d201,
        typeUpdateStickerSets = 0x43ae3dec,
        typeUpdateSavedGifs = 0x9375341e,
        typeUpdateBotInlineQuery = 0x54826690,
        typeUpdateBotInlineSend = 0xe48f964,
        typeUpdateEditChannelMessage = 0x1b3f4df7,
        typeUpdateChannelPinnedMessage = 0x98592475,
        typeUpdateBotCallbackQuery = 0xe73547e1,
        typeUpdateEditMessage = 0xe40370a3,
        typeUpdateInlineBotCallbackQuery = 0xf9d27a5a,
        typeUpdateReadChannelOutbox = 0x25d6c9c7,
        typeUpdateDraftMessage = 0xee2bb969,
        typeUpdateReadFeaturedStickers = 0x571d2742,
        typeUpdateRecentStickers = 0x9a422c20,
        typeUpdateConfig = 0xa229dd06,
        typeUpdatePtsChanged = 0x3354678f,
        typeUpdateChannelWebPage = 0x40771900,
        typeUpdateDialogPinned = 0xd711a2cc,
        typeUpdatePinnedDialogs = 0xd8caf68d,
        typeUpdateBotWebhookJSON = 0x8317c0c3,
        typeUpdateBotWebhookJSONQuery = 0x9b9240a6,
        typeUpdateBotShippingQuery = 0xe0cdc940,
        typeUpdateBotPrecheckoutQuery = 0x5d2f3aa9,
        typeUpdatePhoneCall = 0xab0f6b1e,
        typeUpdateLangPackTooLong = 0x10c2404b,
        typeUpdateLangPack = 0x56022f4d
    };

    Update(UpdateClassType classType = typeUpdateNewMessage, InboundPkt *in = 0);
    Update(InboundPkt *in);
    Update(const Null&);
    Update(const Update &another);
    virtual ~Update();

    void setAction(const SendMessageAction &action);
    SendMessageAction action() const;

    void setBlocked(bool blocked);
    bool blocked() const;

    void setChannelId(qint32 channelId);
    qint32 channelId() const;

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

    void setChatId(qint32 chatId);
    qint32 chatId() const;

    void setChatInstance(qint64 chatInstance);
    qint64 chatInstance() const;

    void setCurrency(const QString &currency);
    QString currency() const;

    void setDataJSON(const DataJSON &dataJSON);
    DataJSON dataJSON() const;

    void setDataBytes(const QByteArray &dataBytes);
    QByteArray dataBytes() const;

    void setDate(qint32 date);
    qint32 date() const;

    void setDcOptions(const QList<DcOption> &dcOptions);
    QList<DcOption> dcOptions() const;

    void setDifference(const LangPackDifference &difference);
    LangPackDifference difference() const;

    void setDraft(const DraftMessage &draft);
    DraftMessage draft() const;

    void setEnabled(bool enabled);
    bool enabled() const;

    void setEntities(const QList<MessageEntity> &entities);
    QList<MessageEntity> entities() const;

    void setFirstName(const QString &firstName);
    QString firstName() const;

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

    void setForeignLink(const ContactLink &foreignLink);
    ContactLink foreignLink() const;

    void setGameShortName(const QString &gameShortName);
    QString gameShortName() const;

    void setGeo(const GeoPoint &geo);
    GeoPoint geo() const;

    void setIdString(const QString &idString);
    QString idString() const;

    void setIdInt(qint32 idInt);
    qint32 idInt() const;

    void setInboxDate(qint32 inboxDate);
    qint32 inboxDate() const;

    void setInfo(const PaymentRequestedInfo &info);
    PaymentRequestedInfo info() const;

    void setInviterId(qint32 inviterId);
    qint32 inviterId() const;

    void setIsAdmin(bool isAdmin);
    bool isAdmin() const;

    void setKey(const PrivacyKey &key);
    PrivacyKey key() const;

    void setLastName(const QString &lastName);
    QString lastName() const;

    void setMasks(bool masks);
    bool masks() const;

    void setMaxDate(qint32 maxDate);
    qint32 maxDate() const;

    void setMaxId(qint32 maxId);
    qint32 maxId() const;

    void setMedia(const MessageMedia &media);
    MessageMedia media() const;

    void setMessageEncrypted(const EncryptedMessage &messageEncrypted);
    EncryptedMessage messageEncrypted() const;

    void setMessage(const Message &message);
    Message message() const;

    void setMessageString(const QString &messageString);
    QString messageString() const;

    void setMessages(const QList<qint32> &messages);
    QList<qint32> messages() const;

    void setMsgIdInputBotInlineMessageID(const InputBotInlineMessageID &msgIdInputBotInlineMessageID);
    InputBotInlineMessageID msgIdInputBotInlineMessageID() const;

    void setMsgIdInt(qint32 msgIdInt);
    qint32 msgIdInt() const;

    void setMyLink(const ContactLink &myLink);
    ContactLink myLink() const;

    void setNotifySettings(const PeerNotifySettings &notifySettings);
    PeerNotifySettings notifySettings() const;

    void setOffset(const QString &offset);
    QString offset() const;

    void setOrderVectorPeer(const QList<Peer> &orderVectorPeer);
    QList<Peer> orderVectorPeer() const;

    void setOrderVectorlong(const QList<qint64> &orderVectorlong);
    QList<qint64> orderVectorlong() const;

    void setParticipants(const ChatParticipants &participants);
    ChatParticipants participants() const;

    void setPayload(const QByteArray &payload);
    QByteArray payload() const;

    void setPeerNotify(const NotifyPeer &peerNotify);
    NotifyPeer peerNotify() const;

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

    void setPhone(const QString &phone);
    QString phone() const;

    void setPhoneCall(const PhoneCall &phoneCall);
    PhoneCall phoneCall() const;

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

    void setPinned(bool pinned);
    bool pinned() const;

    void setPopup(bool popup);
    bool popup() const;

    void setPrevious(bool previous);
    bool previous() const;

    void setPts(qint32 pts);
    qint32 pts() const;

    void setPtsCount(qint32 ptsCount);
    qint32 ptsCount() const;

    void setQts(qint32 qts);
    qint32 qts() const;

    void setQuery(const QString &query);
    QString query() const;

    void setQueryId(qint64 queryId);
    qint64 queryId() const;

    void setRandomId(qint64 randomId);
    qint64 randomId() const;

    void setRules(const QList<PrivacyRule> &rules);
    QList<PrivacyRule> rules() const;

    void setShippingAddress(const PostAddress &shippingAddress);
    PostAddress shippingAddress() const;

    void setShippingOptionId(const QString &shippingOptionId);
    QString shippingOptionId() const;

    void setStatus(const UserStatus &status);
    UserStatus status() const;

    void setStickerset(const MessagesStickerSet &stickerset);
    MessagesStickerSet stickerset() const;

    void setTimeout(qint32 timeout);
    qint32 timeout() const;

    void setTotalAmount(qint64 totalAmount);
    qint64 totalAmount() const;

    void setType(const QString &type);
    QString type() const;

    void setUserId(qint32 userId);
    qint32 userId() const;

    void setUsername(const QString &username);
    QString username() const;

    void setVersion(qint32 version);
    qint32 version() const;

    void setViews(qint32 views);
    qint32 views() const;

    void setWebpage(const WebPage &webpage);
    WebPage webpage() const;

    void setClassType(UpdateClassType classType);
    UpdateClassType classType() const;

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

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

    bool operator ==(const Update &b) const;
    Update &operator =(const Update &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:
    SendMessageAction m_action;
    bool m_blocked;
    qint32 m_channelId;
    EncryptedChat m_chat;
    qint32 m_chatId;
    qint64 m_chatInstance;
    QString m_currency;
    DataJSON m_dataJSON;
    QByteArray m_dataBytes;
    qint32 m_date;
    QList<DcOption> m_dcOptions;
    LangPackDifference m_difference;
    DraftMessage m_draft;
    bool m_enabled;
    QList<MessageEntity> m_entities;
    QString m_firstName;
    qint32 m_flags;
    ContactLink m_foreignLink;
    QString m_gameShortName;
    GeoPoint m_geo;
    QString m_idString;
    qint32 m_idInt;
    qint32 m_inboxDate;
    PaymentRequestedInfo m_info;
    qint32 m_inviterId;
    bool m_isAdmin;
    PrivacyKey m_key;
    QString m_lastName;
    qint32 m_maxDate;
    qint32 m_maxId;
    MessageMedia m_media;
    EncryptedMessage m_messageEncrypted;
    Message m_message;
    QString m_messageString;
    QList<qint32> m_messages;
    InputBotInlineMessageID m_msgIdInputBotInlineMessageID;
    qint32 m_msgIdInt;
    ContactLink m_myLink;
    PeerNotifySettings m_notifySettings;
    QString m_offset;
    QList<Peer> m_orderVectorPeer;
    QList<qint64> m_orderVectorlong;
    ChatParticipants m_participants;
    QByteArray m_payload;
    NotifyPeer m_peerNotify;
    Peer m_peer;
    QString m_phone;
    PhoneCall m_phoneCall;
    UserProfilePhoto m_photo;
    bool m_previous;
    qint32 m_pts;
    qint32 m_ptsCount;
    qint32 m_qts;
    QString m_query;
    qint64 m_queryId;
    qint64 m_randomId;
    QList<PrivacyRule> m_rules;
    PostAddress m_shippingAddress;
    QString m_shippingOptionId;
    UserStatus m_status;
    MessagesStickerSet m_stickerset;
    qint32 m_timeout;
    qint64 m_totalAmount;
    QString m_type;
    qint32 m_userId;
    QString m_username;
    qint32 m_version;
    qint32 m_views;
    WebPage m_webpage;
    UpdateClassType m_classType;
};

Q_DECLARE_METATYPE(Update)

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

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

#endif // LQTG_TYPE_UPDATE
