/**
 * Qt6 Common library
 *
 * The Qt6 Common library is auto-generated and available to users under the same license as the Qt which it is used with or built with. See available licenses below. 
 * SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

#ifndef QOAI_OBJECT_H
#define QOAI_OBJECT_H

#include "qoaiopenapicommoncommonexports.h"

#include <QtCore/qjsonobject.h>
#include <QtCore/qstring.h>

#include <memory>

QT_BEGIN_NAMESPACE

namespace QtOpenApiCommon {

class QOAIObjectPrivate;

class OPENAPICOMMON_COMMON_EXPORT QOAIObject {
public:
    QOAIObject();
    QOAIObject(const QOAIObject &other);
    QOAIObject &operator=(const QOAIObject &other);
    QOAIObject(QOAIObject &&) noexcept;
    QOAIObject &operator=(QOAIObject &&) noexcept;
    virtual ~QOAIObject();

    virtual QJsonObject asJsonObject() const;
    virtual QString asJson() const;
    virtual void fromJson(const QString &jsonString);
    virtual void fromJsonObject(const QJsonObject &json);
    virtual bool isSet() const;
    virtual bool isValid() const;

private:
    friend bool operator==(const QOAIObject &lhs, const QOAIObject &rhs)
    { return lhs.asJsonObject() == rhs.asJsonObject(); }
    friend bool operator!=(const QOAIObject &lhs, const QOAIObject &rhs)
    { return !operator==(lhs, rhs); }

    friend size_t qHash(const QOAIObject &obj, size_t seed)
    { return qHash(obj.asJsonObject(), seed); }
    friend size_t qHash(const QOAIObject &obj)
    { return qHash(obj, 0); }

private:
    // Note that d_ptr refers to QObjectPrivate, which we cannot use because
    // we do not want to link to CorePrivate
    friend class QOAIObjectPrivate;
    std::unique_ptr<QOAIObjectPrivate> d;
};

} // namespace QtOpenApiCommon

QT_END_NAMESPACE

#endif // QOAI_OBJECT_H
