// 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_DCOPTION
#define LQTG_TYPE_DCOPTION

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QtGlobal>
#include <QString>

class LIBQTELEGRAMSHARED_EXPORT DcOption : public TelegramTypeObject
{
public:
    enum DcOptionClassType {
        typeDcOption = 0x5d8c6cc
    };

    DcOption(DcOptionClassType classType = typeDcOption, InboundPkt *in = 0);
    DcOption(InboundPkt *in);
    DcOption(const Null&);
    DcOption(const DcOption &another);
    virtual ~DcOption();

    void setCdn(bool cdn);
    bool cdn() const;

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

    void setId(qint32 id);
    qint32 id() const;

    void setIpAddress(const QString &ipAddress);
    QString ipAddress() const;

    void setIpv6(bool ipv6);
    bool ipv6() const;

    void setMediaOnly(bool mediaOnly);
    bool mediaOnly() const;

    void setPort(qint32 port);
    qint32 port() const;

    void setStaticValue(bool staticValue);
    bool staticValue() const;

    void setTcpoOnly(bool tcpoOnly);
    bool tcpoOnly() const;

    void setClassType(DcOptionClassType classType);
    DcOptionClassType classType() const;

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

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

    bool operator ==(const DcOption &b) const;
    DcOption &operator =(const DcOption &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_flags;
    qint32 m_id;
    QString m_ipAddress;
    qint32 m_port;
    DcOptionClassType m_classType;
};

Q_DECLARE_METATYPE(DcOption)

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

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

#endif // LQTG_TYPE_DCOPTION
