// 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_FILELOCATION
#define LQTG_TYPE_FILELOCATION

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QtGlobal>

class LIBQTELEGRAMSHARED_EXPORT FileLocation : public TelegramTypeObject
{
public:
    enum FileLocationClassType {
        typeFileLocationUnavailable = 0x7c596b46,
        typeFileLocation = 0x53d69076,
        typeFileLocationUnavailableSecret23 = 0x7c596b46,
        typeFileLocationSecret23 = 0x53d69076
    };

    FileLocation(FileLocationClassType classType = typeFileLocationUnavailable, InboundPkt *in = 0);
    FileLocation(InboundPkt *in);
    FileLocation(const Null&);
    FileLocation(const FileLocation &another);
    virtual ~FileLocation();

    void setDcId(qint32 dcId);
    qint32 dcId() const;

    void setLocalId(qint32 localId);
    qint32 localId() const;

    void setSecret(qint64 secret);
    qint64 secret() const;

    void setVolumeId(qint64 volumeId);
    qint64 volumeId() const;

    void setClassType(FileLocationClassType classType);
    FileLocationClassType classType() const;

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

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

    bool operator ==(const FileLocation &b) const;
    FileLocation &operator =(const FileLocation &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:
    qint32 m_dcId;
    qint32 m_localId;
    qint64 m_secret;
    qint64 m_volumeId;
    FileLocationClassType m_classType;
};

Q_DECLARE_METATYPE(FileLocation)

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

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

#endif // LQTG_TYPE_FILELOCATION
