// 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_POSTADDRESS
#define LQTG_TYPE_POSTADDRESS

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QString>

class LIBQTELEGRAMSHARED_EXPORT PostAddress : public TelegramTypeObject
{
public:
    enum PostAddressClassType {
        typePostAddress = 0x1e8caaeb
    };

    PostAddress(PostAddressClassType classType = typePostAddress, InboundPkt *in = 0);
    PostAddress(InboundPkt *in);
    PostAddress(const Null&);
    PostAddress(const PostAddress &another);
    virtual ~PostAddress();

    void setCity(const QString &city);
    QString city() const;

    void setCountryIso2(const QString &countryIso2);
    QString countryIso2() const;

    void setPostCode(const QString &postCode);
    QString postCode() const;

    void setState(const QString &state);
    QString state() const;

    void setStreetLine1(const QString &streetLine1);
    QString streetLine1() const;

    void setStreetLine2(const QString &streetLine2);
    QString streetLine2() const;

    void setClassType(PostAddressClassType classType);
    PostAddressClassType classType() const;

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

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

    bool operator ==(const PostAddress &b) const;
    PostAddress &operator =(const PostAddress &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:
    QString m_city;
    QString m_countryIso2;
    QString m_postCode;
    QString m_state;
    QString m_streetLine1;
    QString m_streetLine2;
    PostAddressClassType m_classType;
};

Q_DECLARE_METATYPE(PostAddress)

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

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

#endif // LQTG_TYPE_POSTADDRESS
