
// Workaround to access protected functions
#ifndef protected
#  define protected public
#endif

// default includes
#include <shiboken.h>
#include <sbkpep.h>
#include <sbkpepbuffer.h>

#define PYSIDE6_COMOPT_COMPRESS 1

#ifndef QT_NO_VERSION_TAGGING
#  define QT_NO_VERSION_TAGGING
#endif
#include <QtCore/QDebug>
#include <pysideqenum.h>
#include <pysideutils.h>
#include <feature_select.h>
QT_WARNING_DISABLE_DEPRECATED


// module include
#include "kcalendarcore_python.h"

// main header
#include "kcalendarcore_schedulemessage_wrapper.h"

// Argument includes
#include <QString>
#include <schedulemessage.h>

#include <cctype>
#include <cstring>
#include <iterator>
#include <type_traits>
#include <typeinfo>

using namespace KCalendarCore;

extern "C" {
static PyTypeObject *Sbk_KCalendarCore_ScheduleMessage_TypeF(void)
{
    return SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_ScheduleMessage_IDX].type;
}
} // extern "C"


// Target ---------------------------------------------------------

extern "C" {
static int Sbk_KCalendarCore_ScheduleMessage_Init(PyObject *, PyObject *, PyObject *)
{
    Shiboken::Errors::setInstantiateNonConstructible("ScheduleMessage");
    return -1;
}

static PyObject *Sbk_KCalendarCore_ScheduleMessageFunc_error(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCalendarCore::ScheduleMessage *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_ScheduleMessage_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    Shiboken::PythonContextMarker pcm;

    // Call function/method
    {

        // ScheduleMessage::error()const->QString
        QString cppResult = const_cast<const ::KCalendarCore::ScheduleMessage *>(cppSelf)->error();
        pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypeConverters[SBK_QString_IDX], &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_KCalendarCore_ScheduleMessageFunc_method(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCalendarCore::ScheduleMessage *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_ScheduleMessage_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    Shiboken::PythonContextMarker pcm;

    // Call function/method
    {

        // ScheduleMessage::method()const->KCalendarCore::iTIPMethod
        KCalendarCore::iTIPMethod cppResult = const_cast<const ::KCalendarCore::ScheduleMessage *>(cppSelf)->method();
        pyResult = Shiboken::Conversions::copyToPython(Shiboken::Enum::getConverter(reinterpret_cast<SbkEnumType *>(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_iTIPMethod_IDX]))), &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_KCalendarCore_ScheduleMessageFunc_methodName([[maybe_unused]] PyObject *self, PyObject *pyArg)
{
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp;

    // Overloaded function decisor
    // 0: static ScheduleMessage::methodName(KCalendarCore::iTIPMethod)->QString
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Enum::getConverter(reinterpret_cast<SbkEnumType *>(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_iTIPMethod_IDX]))), (pyArg)))) {
        overloadId = 0; // static ScheduleMessage::methodName(KCalendarCore::iTIPMethod)->QString
    }

    // Function signature not found.
    if (overloadId == -1)
        return Shiboken::returnWrongArguments(pyArg, "methodName", SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_ScheduleMessage_IDX]);

    // Call function/method
    {
        ::KCalendarCore::iTIPMethod cppArg0{KCalendarCore::iTIPPublish};
        pythonToCpp(pyArg, &cppArg0);

        if (Shiboken::Errors::occurred() == nullptr) {
            // static ScheduleMessage::methodName(KCalendarCore::iTIPMethod)->QString
            QString cppResult = ::KCalendarCore::ScheduleMessage::methodName(cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypeConverters[SBK_QString_IDX], &cppResult);
        }
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_KCalendarCore_ScheduleMessageFunc_status(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCalendarCore::ScheduleMessage *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_ScheduleMessage_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    Shiboken::PythonContextMarker pcm;

    // Call function/method
    {

        // ScheduleMessage::status()const->KCalendarCore::ScheduleMessage::Status
        KCalendarCore::ScheduleMessage::Status cppResult = const_cast<const ::KCalendarCore::ScheduleMessage *>(cppSelf)->status();
        pyResult = Shiboken::Conversions::copyToPython(Shiboken::Enum::getConverter(reinterpret_cast<SbkEnumType *>(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_ScheduleMessage_Status_IDX]))), &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}


static const char *Sbk_KCalendarCore_ScheduleMessage_PropertyStrings[] = {
    nullptr // Sentinel
};

static const char *Sbk_KCalendarCore_ScheduleMessage_EnumFlagInfo[] = {
    "Status:IntEnum",
    nullptr // Sentinel
};

static PyMethodDef Sbk_KCalendarCore_ScheduleMessage_methods[] = {
    {"error", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_ScheduleMessageFunc_error), METH_NOARGS, nullptr},
    {"method", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_ScheduleMessageFunc_method), METH_NOARGS, nullptr},
    {"methodName", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_ScheduleMessageFunc_methodName), METH_O|METH_STATIC, nullptr},
    {"status", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_ScheduleMessageFunc_status), METH_NOARGS, nullptr},
    {nullptr, nullptr, 0, nullptr} // Sentinel
};

} // extern "C"

static int Sbk_KCalendarCore_ScheduleMessage_traverse(PyObject *self, visitproc visit, void *arg)
{
    auto traverseProc = reinterpret_cast<traverseproc>(PyType_GetSlot(SbkObject_TypeF(), Py_tp_traverse));
    ;
    return traverseProc(self, visit, arg);
}
static int Sbk_KCalendarCore_ScheduleMessage_clear(PyObject *self)
{
    auto clearProc = reinterpret_cast<inquiry>(PyType_GetSlot(SbkObject_TypeF(), Py_tp_clear));
    ;
    return clearProc(self);
}

// Class Definition -----------------------------------------------
extern "C" {

static PyType_Slot Sbk_KCalendarCore_ScheduleMessage_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_KCalendarCore_ScheduleMessage_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_KCalendarCore_ScheduleMessage_clear)},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_KCalendarCore_ScheduleMessage_methods)},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_KCalendarCore_ScheduleMessage_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)},
    {0, nullptr}
};
static PyType_Spec Sbk_KCalendarCore_ScheduleMessage_spec = {
    "1:KCalendarCore.KCalendarCore.ScheduleMessage",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_KCalendarCore_ScheduleMessage_slots
};

} //extern "C"

// Type conversion functions.

// Python to C++ enum conversion.
static void Enum_PythonToCpp_KCalendarCore_ScheduleMessage_Status(PyObject *pyIn, void *cppOut)
{
    const auto value = static_cast<::KCalendarCore::ScheduleMessage::Status>(Shiboken::Enum::getValue(pyIn));
    *reinterpret_cast<::KCalendarCore::ScheduleMessage::Status *>(cppOut) = value;

}
static PythonToCppFunc is_Enum_PythonToCpp_KCalendarCore_ScheduleMessage_Status_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_ScheduleMessage_Status_IDX])))
        return Enum_PythonToCpp_KCalendarCore_ScheduleMessage_Status;
    return {};
}

static PyObject *KCalendarCore_ScheduleMessage_Status_CppToPython_Enum(PyTypeObject *pyType, const void *cppIn)
{
    using IntType = std::underlying_type_t<::KCalendarCore::ScheduleMessage::Status>;
    const auto castCppIn = IntType(*reinterpret_cast<const ::KCalendarCore::ScheduleMessage::Status *>(cppIn));
    return Shiboken::Enum::newItem(pyType, castCppIn);

}

// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity).
static void ScheduleMessage_PythonToCpp_ScheduleMessage_PTR(PyObject *pyIn, void *cppOut)
{
    Shiboken::Conversions::pythonToCppPointer(Sbk_KCalendarCore_ScheduleMessage_TypeF(), pyIn, cppOut);
}
static PythonToCppFunc is_ScheduleMessage_PythonToCpp_ScheduleMessage_PTR_Convertible(PyObject *pyIn)
{
    if (pyIn == Py_None)
        return Shiboken::Conversions::nonePythonToCppNullPtr;
    if (PyObject_TypeCheck(pyIn, Sbk_KCalendarCore_ScheduleMessage_TypeF()))
        return ScheduleMessage_PythonToCpp_ScheduleMessage_PTR;
    return {};
}

// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity).
static PyObject *ScheduleMessage_PTR_CppToPython_ScheduleMessage(const void *cppIn)
{
    auto *pyOut = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(cppIn, Sbk_KCalendarCore_ScheduleMessage_TypeF()));
    if (pyOut) {
        Py_INCREF(pyOut);
        return pyOut;
    }
    return Shiboken::Object::newObjectWithHeuristics(Sbk_KCalendarCore_ScheduleMessage_TypeF(), const_cast<void *>(cppIn), false);

}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
#if PYSIDE6_COMOPT_COMPRESS == 0
static const char *KCalendarCore_ScheduleMessage_SignatureStrings[] = {
    "KCalendarCore.KCalendarCore.ScheduleMessage.error(self)->QString",
    "KCalendarCore.KCalendarCore.ScheduleMessage.method(self)->KCalendarCore.KCalendarCore.iTIPMethod",
    "KCalendarCore.KCalendarCore.ScheduleMessage.methodName(method:KCalendarCore.KCalendarCore.iTIPMethod)->QString",
    "KCalendarCore.KCalendarCore.ScheduleMessage.status(self)->KCalendarCore.KCalendarCore.ScheduleMessage.Status",
    nullptr}; // Sentinel
#else
static constexpr size_t KCalendarCore_ScheduleMessage_SignatureByteSize = 113;
static constexpr uint8_t KCalendarCore_ScheduleMessage_SignatureBytes[113] = {
    0x78, 0xda, 0xf3, 0x76, 0x4e, 0xcc, 0x49, 0xcd, 0x4b, 0x49, 0x2c, 0x72, 0xce, 0x2f, 0x4a, 0xd5,
    0xf3, 0x46, 0xe1, 0x05, 0x27, 0x67, 0xa4, 0xa6, 0x94, 0xe6, 0xa4, 0xfa, 0xa6, 0x16, 0x17, 0x27,
    0xa6, 0xa7, 0xea, 0xa5, 0x16, 0x15, 0xe5, 0x17, 0x69, 0x14, 0xa7, 0xe6, 0xa4, 0x69, 0xea, 0xda,
    0x05, 0x06, 0x97, 0x14, 0x65, 0xe6, 0xa5, 0x73, 0x79, 0x93, 0x60, 0x40, 0x6e, 0x6a, 0x49, 0x46,
    0x7e, 0x0a, 0xcc, 0x04, 0x7c, 0x3a, 0x33, 0x43, 0x3c, 0x03, 0x7c, 0xc1, 0xaa, 0xc9, 0xb0, 0xc0,
    0x2f, 0x31, 0x37, 0x55, 0x03, 0xc2, 0xb4, 0x22, 0xce, 0x12, 0x32, 0xfd, 0x53, 0x5c, 0x92, 0x58,
    0x52, 0x5a, 0x4c, 0x8c, 0x7f, 0xd0, 0x75, 0x06, 0x83, 0x75, 0x72, 0x01, 0x00, 0x8a, 0x25, 0x8b,
    0xcd
};
#endif

PyTypeObject *init_KCalendarCore_ScheduleMessage(PyObject *enclosingClass)
{
    auto &typeStruct = SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_ScheduleMessage_IDX];
    if (typeStruct.type != nullptr)
        return typeStruct.type;

    auto *base1 = SbkObject_TypeF();
    Shiboken::AutoDecRef Sbk_KCalendarCore_ScheduleMessage_Type_bases(PyTuple_Pack(1, base1));

    PyTypeObject *pyType = Shiboken::ObjectType::introduceWrapperType(
        enclosingClass,
        "ScheduleMessage",
        "KCalendarCore::ScheduleMessage*",
        &Sbk_KCalendarCore_ScheduleMessage_spec,
        &Shiboken::callCppDestructor< ::KCalendarCore::ScheduleMessage >,
        Sbk_KCalendarCore_ScheduleMessage_Type_bases.object(),
        Shiboken::ObjectType::WrapperFlags::InnerClass);
#if PYSIDE6_COMOPT_COMPRESS == 0
    InitSignatureStrings(pyType, KCalendarCore_ScheduleMessage_SignatureStrings);
#else
    InitSignatureBytes(pyType, KCalendarCore_ScheduleMessage_SignatureBytes, KCalendarCore_ScheduleMessage_SignatureByteSize);
#endif
    SbkObjectType_SetPropertyStrings(pyType, Sbk_KCalendarCore_ScheduleMessage_PropertyStrings);
    typeStruct.type = pyType;

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(pyType,
        ScheduleMessage_PythonToCpp_ScheduleMessage_PTR,
        is_ScheduleMessage_PythonToCpp_ScheduleMessage_PTR_Convertible,
        ScheduleMessage_PTR_CppToPython_ScheduleMessage);

    Shiboken::Conversions::registerConverterName(converter, "KCalendarCore::ScheduleMessage");
    Shiboken::Conversions::registerConverterName(converter, "KCalendarCore::ScheduleMessage*");
    Shiboken::Conversions::registerConverterName(converter, "KCalendarCore::ScheduleMessage&");
    Shiboken::Conversions::registerConverterAlias(converter, "ScheduleMessage");
    Shiboken::Conversions::registerConverterAlias(converter, "ScheduleMessage*");
    Shiboken::Conversions::registerConverterAlias(converter, "ScheduleMessage&");
    Shiboken::Conversions::registerConverterName(converter, typeid(::KCalendarCore::ScheduleMessage).name());

    // Pass the ..._EnumFlagInfo to the class.
    SbkObjectType_SetEnumFlagInfo(pyType, Sbk_KCalendarCore_ScheduleMessage_EnumFlagInfo);

    // Initialization of enums.
    Shiboken::AutoDecRef tpDict{};
    [[maybe_unused]] PyTypeObject *EType{};

    // Initialization of enum 'Status'.
    const char *Status_Initializer[] = {
        "PublishNew",
        "PublishUpdate",
        "Obsolete",
        "RequestNew",
        "RequestUpdate",
        "Unknown",
        nullptr};
    // "uint8_t" used instead of "unsigned int"
    constexpr uint8_t Status_InitializerValues[] = {
        uint8_t(KCalendarCore::ScheduleMessage::Status::PublishNew),    //  0x00  0
        uint8_t(KCalendarCore::ScheduleMessage::Status::PublishUpdate), //  0x01  1
        uint8_t(KCalendarCore::ScheduleMessage::Status::Obsolete),      //  0x02  2
        uint8_t(KCalendarCore::ScheduleMessage::Status::RequestNew),    //  0x03  3
        uint8_t(KCalendarCore::ScheduleMessage::Status::RequestUpdate), //  0x04  4
        uint8_t(KCalendarCore::ScheduleMessage::Status::Unknown)        //  0x05  5
        };
    EType = Shiboken::Enum::createPythonEnum(pyType,
        "1:KCalendarCore.KCalendarCore.ScheduleMessage.Status",
        Status_Initializer, Status_InitializerValues);
    SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_ScheduleMessage_Status_IDX].type = EType;
    // Register converter for enum 'KCalendarCore::ScheduleMessage::Status'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(EType,
            KCalendarCore_ScheduleMessage_Status_CppToPython_Enum);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            Enum_PythonToCpp_KCalendarCore_ScheduleMessage_Status,
            is_Enum_PythonToCpp_KCalendarCore_ScheduleMessage_Status_Convertible);
        Shiboken::Conversions::registerConverterName(converter, "KCalendarCore::ScheduleMessage::Status");
        Shiboken::Conversions::registerConverterAlias(converter, "ScheduleMessage::Status");
        Shiboken::Conversions::registerConverterAlias(converter, "Status");
        Shiboken::Enum::setTypeConverter(EType, converter, nullptr);
    }
    // End of 'Status' enum.

    qRegisterMetaType< ::KCalendarCore::ScheduleMessage *>();
    qRegisterMetaType< ::KCalendarCore::ScheduleMessage::Status >("ScheduleMessage::Status");
    qRegisterMetaType< ::KCalendarCore::ScheduleMessage::Status >("KCalendarCore::ScheduleMessage::Status");

    return pyType;
}
