// 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_PAYMENTSSAVEDINFO
#define LQTG_TYPE_PAYMENTSSAVEDINFO

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QtGlobal>
#include "paymentrequestedinfo.h"

class LIBQTELEGRAMSHARED_EXPORT PaymentsSavedInfo : public TelegramTypeObject
{
public:
    enum PaymentsSavedInfoClassType {
        typePaymentsSavedInfo = 0xfb8fe43c
    };

    PaymentsSavedInfo(PaymentsSavedInfoClassType classType = typePaymentsSavedInfo, InboundPkt *in = 0);
    PaymentsSavedInfo(InboundPkt *in);
    PaymentsSavedInfo(const Null&);
    PaymentsSavedInfo(const PaymentsSavedInfo &another);
    virtual ~PaymentsSavedInfo();

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

    void setHasSavedCredentials(bool hasSavedCredentials);
    bool hasSavedCredentials() const;

    void setSavedInfo(const PaymentRequestedInfo &savedInfo);
    PaymentRequestedInfo savedInfo() const;

    void setClassType(PaymentsSavedInfoClassType classType);
    PaymentsSavedInfoClassType classType() const;

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

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

    bool operator ==(const PaymentsSavedInfo &b) const;
    PaymentsSavedInfo &operator =(const PaymentsSavedInfo &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;
    PaymentRequestedInfo m_savedInfo;
    PaymentsSavedInfoClassType m_classType;
};

Q_DECLARE_METATYPE(PaymentsSavedInfo)

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

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

#endif // LQTG_TYPE_PAYMENTSSAVEDINFO
