// 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_PHONECALL
#define LQTG_TYPE_PHONECALL

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QtGlobal>
#include <QList>
#include "phoneconnection.h"
#include <QByteArray>
#include "phonecallprotocol.h"
#include "phonecalldiscardreason.h"

class LIBQTELEGRAMSHARED_EXPORT PhoneCall : public TelegramTypeObject
{
public:
    enum PhoneCallClassType {
        typePhoneCallEmpty = 0x5366c915,
        typePhoneCallWaiting = 0x1b8f4ad1,
        typePhoneCallRequested = 0x83761ce4,
        typePhoneCallAccepted = 0x6d003d3f,
        typePhoneCall = 0xffe6ab67,
        typePhoneCallDiscarded = 0x50ca4de1
    };

    PhoneCall(PhoneCallClassType classType = typePhoneCallEmpty, InboundPkt *in = 0);
    PhoneCall(InboundPkt *in);
    PhoneCall(const Null&);
    PhoneCall(const PhoneCall &another);
    virtual ~PhoneCall();

    void setAccessHash(qint64 accessHash);
    qint64 accessHash() const;

    void setAdminId(qint32 adminId);
    qint32 adminId() const;

    void setAlternativeConnections(const QList<PhoneConnection> &alternativeConnections);
    QList<PhoneConnection> alternativeConnections() const;

    void setConnection(const PhoneConnection &connection);
    PhoneConnection connection() const;

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

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

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

    void setGAHash(const QByteArray &gAHash);
    QByteArray gAHash() const;

    void setGAOrB(const QByteArray &gAOrB);
    QByteArray gAOrB() const;

    void setGB(const QByteArray &gB);
    QByteArray gB() const;

    void setId(qint64 id);
    qint64 id() const;

    void setKeyFingerprint(qint64 keyFingerprint);
    qint64 keyFingerprint() const;

    void setNeedDebug(bool needDebug);
    bool needDebug() const;

    void setNeedRating(bool needRating);
    bool needRating() const;

    void setParticipantId(qint32 participantId);
    qint32 participantId() const;

    void setProtocol(const PhoneCallProtocol &protocol);
    PhoneCallProtocol protocol() const;

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

    void setReceiveDate(qint32 receiveDate);
    qint32 receiveDate() const;

    void setStartDate(qint32 startDate);
    qint32 startDate() const;

    void setClassType(PhoneCallClassType classType);
    PhoneCallClassType classType() const;

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

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

    bool operator ==(const PhoneCall &b) const;
    PhoneCall &operator =(const PhoneCall &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_accessHash;
    qint32 m_adminId;
    QList<PhoneConnection> m_alternativeConnections;
    PhoneConnection m_connection;
    qint32 m_date;
    qint32 m_duration;
    qint32 m_flags;
    QByteArray m_gAHash;
    QByteArray m_gAOrB;
    QByteArray m_gB;
    qint64 m_id;
    qint64 m_keyFingerprint;
    qint32 m_participantId;
    PhoneCallProtocol m_protocol;
    PhoneCallDiscardReason m_reason;
    qint32 m_receiveDate;
    qint32 m_startDate;
    PhoneCallClassType m_classType;
};

Q_DECLARE_METATYPE(PhoneCall)

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

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

#endif // LQTG_TYPE_PHONECALL
