// 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_PRIVACYKEY
#define LQTG_TYPE_PRIVACYKEY

#include "telegramtypeobject.h"

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

#include <QDataStream>


class LIBQTELEGRAMSHARED_EXPORT PrivacyKey : public TelegramTypeObject
{
public:
    enum PrivacyKeyClassType {
        typePrivacyKeyStatusTimestamp = 0xbc2eab30,
        typePrivacyKeyChatInvite = 0x500e6dfa,
        typePrivacyKeyPhoneCall = 0x3d662b7b
    };

    PrivacyKey(PrivacyKeyClassType classType = typePrivacyKeyStatusTimestamp, InboundPkt *in = 0);
    PrivacyKey(InboundPkt *in);
    PrivacyKey(const Null&);
    PrivacyKey(const PrivacyKey &another);
    virtual ~PrivacyKey();

    void setClassType(PrivacyKeyClassType classType);
    PrivacyKeyClassType classType() const;

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

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

    bool operator ==(const PrivacyKey &b) const;
    PrivacyKey &operator =(const PrivacyKey &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:
    PrivacyKeyClassType m_classType;
};

Q_DECLARE_METATYPE(PrivacyKey)

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

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

#endif // LQTG_TYPE_PRIVACYKEY
