/**
 * Qt6 Common library
 *
 * Copyright (C) 2026 The Qt Company Ltd.
 * 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.
 */

/**
 * Representing a Server Variable for server URL template substitution.
 */
#ifndef QOAI_SERVERVARIABLE_H
#define QOAI_SERVERVARIABLE_H

#include "qoaicmakecommonlibgeneratedclientcommonexports.h"

#include <QtCore/qcontainerfwd.h>
#include <QtCore/qshareddata.h>

QT_BEGIN_NAMESPACE

namespace QtOpenApiCommon {

class QOAIServerVariablePrivate;
class QOAIServerVariable {
public:
    enum class ServerError
    {
        NoError = 0, // Success
        ServerVariableNotFound = -1,
        EnumValueNotFound = -2,   // The value is not defined in m_enumValues
        OperationNotFound = -3,
        ServerIndexNotFound = -4,
    };

    /**
     * @param description A description for the server variable.
     * @param defaultValue The default value to use for substitution.
     * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set.
     */
    CMAKECOMMONLIBGENERATEDCLIENT_COMMON_EXPORT
    QOAIServerVariable(const QString &description, const QString &defaultValue, const QSet<QString> &enumValues);

    CMAKECOMMONLIBGENERATEDCLIENT_COMMON_EXPORT QOAIServerVariable();
    CMAKECOMMONLIBGENERATEDCLIENT_COMMON_EXPORT ~QOAIServerVariable();

    CMAKECOMMONLIBGENERATEDCLIENT_COMMON_EXPORT
    QOAIServerVariable(const QOAIServerVariable &other);
    CMAKECOMMONLIBGENERATEDCLIENT_COMMON_EXPORT
    QOAIServerVariable &operator=(const QOAIServerVariable &other);

    CMAKECOMMONLIBGENERATEDCLIENT_COMMON_EXPORT
    QOAIServerVariable(QOAIServerVariable &&other) noexcept;
    CMAKECOMMONLIBGENERATEDCLIENT_COMMON_EXPORT
    QOAIServerVariable &operator=(QOAIServerVariable &&other) noexcept;

    CMAKECOMMONLIBGENERATEDCLIENT_COMMON_EXPORT void swap(QOAIServerVariable &other) noexcept;

    CMAKECOMMONLIBGENERATEDCLIENT_COMMON_EXPORT ServerError setValue(const QString& value);

    CMAKECOMMONLIBGENERATEDCLIENT_COMMON_EXPORT QString value() const;
    CMAKECOMMONLIBGENERATEDCLIENT_COMMON_EXPORT QSet<QString> enumValues() const;
    CMAKECOMMONLIBGENERATEDCLIENT_COMMON_EXPORT QString description() const;

private:
    CMAKECOMMONLIBGENERATEDCLIENT_COMMON_EXPORT friend bool
    comparesEqual(const QOAIServerVariable &lhs, const QOAIServerVariable &rhs) noexcept;

    friend bool
    operator==(const QOAIServerVariable &lhs, const QOAIServerVariable &rhs) noexcept
    { return comparesEqual(lhs, rhs); }
    friend bool
    operator!=(const QOAIServerVariable &lhs, const QOAIServerVariable &rhs) noexcept
    { return !comparesEqual(lhs, rhs); }

    friend size_t qHash(const QOAIServerVariable &value) = delete;
    friend size_t qHash(const QOAIServerVariable &value, size_t seed) = delete;

    QExplicitlySharedDataPointer<QOAIServerVariablePrivate> d_ptr;
};

} // namespace QtOpenApiCommon

QT_END_NAMESPACE

#endif // QOAI_SERVERVARIABLE_H
