// 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_MESSAGEACTION
#define LQTG_TYPE_MESSAGEACTION

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QtGlobal>
#include "paymentcharge.h"
#include <QString>
#include "paymentrequestedinfo.h"
#include <QByteArray>
#include "photo.h"
#include "phonecalldiscardreason.h"
#include <QList>

class LIBQTELEGRAMSHARED_EXPORT MessageAction : public TelegramTypeObject
{
public:
    enum MessageActionClassType {
        typeMessageActionEmpty = 0xb6aef7b0,
        typeMessageActionChatCreate = 0xa6638b9a,
        typeMessageActionChatEditTitle = 0xb5a1ce5a,
        typeMessageActionChatEditPhoto = 0x7fcb13a8,
        typeMessageActionChatDeletePhoto = 0x95e3fbef,
        typeMessageActionChatAddUser = 0x488a7337,
        typeMessageActionChatDeleteUser = 0xb2ae9b0c,
        typeMessageActionChatJoinedByLink = 0xf89cf5e8,
        typeMessageActionChannelCreate = 0x95d2ac92,
        typeMessageActionChatMigrateTo = 0x51bdb021,
        typeMessageActionChannelMigrateFrom = 0xb055eaee,
        typeMessageActionPinMessage = 0x94bd38ed,
        typeMessageActionHistoryClear = 0x9fbab604,
        typeMessageActionGameScore = 0x92a72876,
        typeMessageActionPaymentSentMe = 0x8f31b327,
        typeMessageActionPaymentSent = 0x40699cd0,
        typeMessageActionPhoneCall = 0x80e11a7f
    };

    MessageAction(MessageActionClassType classType = typeMessageActionEmpty, InboundPkt *in = 0);
    MessageAction(InboundPkt *in);
    MessageAction(const Null&);
    MessageAction(const MessageAction &another);
    virtual ~MessageAction();

    void setCallId(qint64 callId);
    qint64 callId() const;

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

    void setCharge(const PaymentCharge &charge);
    PaymentCharge charge() const;

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

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

    void setDuration(qint32 duration);
    qint32 duration() const;

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

    void setGameId(qint64 gameId);
    qint64 gameId() const;

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

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

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

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

    void setReason(const PhoneCallDiscardReason &reason);
    PhoneCallDiscardReason reason() const;

    void setScore(qint32 score);
    qint32 score() const;

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

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

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

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

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

    void setClassType(MessageActionClassType classType);
    MessageActionClassType classType() const;

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

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

    bool operator ==(const MessageAction &b) const;
    MessageAction &operator =(const MessageAction &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:
    qint64 m_callId;
    qint32 m_channelId;
    PaymentCharge m_charge;
    qint32 m_chatId;
    QString m_currency;
    qint32 m_duration;
    qint32 m_flags;
    qint64 m_gameId;
    PaymentRequestedInfo m_info;
    qint32 m_inviterId;
    QByteArray m_payload;
    Photo m_photo;
    PhoneCallDiscardReason m_reason;
    qint32 m_score;
    QString m_shippingOptionId;
    QString m_title;
    qint64 m_totalAmount;
    qint32 m_userId;
    QList<qint32> m_users;
    MessageActionClassType m_classType;
};

Q_DECLARE_METATYPE(MessageAction)

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

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

#endif // LQTG_TYPE_MESSAGEACTION
