// 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_INVOICE
#define LQTG_TYPE_INVOICE

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QString>
#include <QtGlobal>
#include <QList>
#include "labeledprice.h"

class LIBQTELEGRAMSHARED_EXPORT Invoice : public TelegramTypeObject
{
public:
    enum InvoiceClassType {
        typeInvoice = 0xc30aa358
    };

    Invoice(InvoiceClassType classType = typeInvoice, InboundPkt *in = 0);
    Invoice(InboundPkt *in);
    Invoice(const Null&);
    Invoice(const Invoice &another);
    virtual ~Invoice();

    void setCurrency(const QString &currency);
    QString currency() const;

    void setEmailRequested(bool emailRequested);
    bool emailRequested() const;

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

    void setFlexible(bool flexible);
    bool flexible() const;

    void setNameRequested(bool nameRequested);
    bool nameRequested() const;

    void setPhoneRequested(bool phoneRequested);
    bool phoneRequested() const;

    void setPrices(const QList<LabeledPrice> &prices);
    QList<LabeledPrice> prices() const;

    void setShippingAddressRequested(bool shippingAddressRequested);
    bool shippingAddressRequested() const;

    void setTest(bool test);
    bool test() const;

    void setClassType(InvoiceClassType classType);
    InvoiceClassType classType() const;

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

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

    bool operator ==(const Invoice &b) const;
    Invoice &operator =(const Invoice &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_currency;
    qint32 m_flags;
    QList<LabeledPrice> m_prices;
    InvoiceClassType m_classType;
};

Q_DECLARE_METATYPE(Invoice)

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

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

#endif // LQTG_TYPE_INVOICE
