
// 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_duration_wrapper.h"

// Argument includes
#include <duration.h>
#include <qdatastream.h>
#include <qdatetime.h>

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

using namespace KCalendarCore;

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


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

extern "C" {
static int
Sbk_KCalendarCore_Duration_Init(PyObject *self, PyObject *args, [[maybe_unused]] PyObject *kwds)
{
    auto *sbkSelf = reinterpret_cast<SbkObject *>(self);
    PySide::Feature::Select(self);
    if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::KCalendarCore::Duration >()))
        return -1;

    ::KCalendarCore::Duration *cptr{};
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp[3];
    const Py_ssize_t numArgs = PyTuple_Size(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {nullptr, nullptr, nullptr};

    // invalid argument lengths
    errInfo.reset(Shiboken::checkInvalidArgumentCount(numArgs, 0, 3));
    if (!errInfo.isNull())
        return Shiboken::returnWrongArguments_MinusOne(args, "__init__", errInfo, SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]);

    if (PyArg_ParseTuple(args, "|OOO:Duration", &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2])) == 0)
        return -1;


    // Overloaded function decisor
    // 0: Duration::Duration()
    // 1: Duration::Duration(const KCalendarCore::Duration&)
    // 2: Duration::Duration(const QDateTime&,const QDateTime&)
    // 3: Duration::Duration(const QDateTime&,const QDateTime&,KCalendarCore::Duration::Type)
    // 4: Duration::Duration(int,KCalendarCore::Duration::Type=)
    if (numArgs == 0) {
        overloadId = 0; // Duration()
    } else if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 4; // Duration(int,KCalendarCore::Duration::Type)
        } else if (numArgs >= 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Enum::getConverter(reinterpret_cast<SbkEnumType *>(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_Type_IDX]))), (pyArgs[1])))) {
            overloadId = 4; // Duration::Duration(int,KCalendarCore::Duration::Type=)
        }
    } else if (numArgs >= 2
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QDateTime_IDX]), (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QDateTime_IDX]), (pyArgs[1])))) {
        if (numArgs == 2) {
            overloadId = 2; // Duration(QDateTime,QDateTime)
        } else if (numArgs == 3
            && (pythonToCpp[2] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Enum::getConverter(reinterpret_cast<SbkEnumType *>(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_Type_IDX]))), (pyArgs[2])))) {
            overloadId = 3; // Duration::Duration(const QDateTime&,const QDateTime&,KCalendarCore::Duration::Type)
        }
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), (pyArgs[0])))) {
        overloadId = 1; // Duration::Duration(const KCalendarCore::Duration&)
    }

    // Function signature not found.
    if (overloadId == -1)
        return Shiboken::returnWrongArguments_MinusOne(args, "__init__", SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]);

    // Resolve keyword arguments
    switch (overloadId) {
        case 0: // Duration::Duration()
        {
            if (kwds != nullptr && PyDict_Size(kwds) > 0) {
                errInfo.reset(kwds);
                Py_INCREF(errInfo.object());
                return Shiboken::returnWrongArguments_MinusOne(args, "__init__", errInfo, SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]);
            }
            break;
        }
        case 1: // Duration::Duration(const KCalendarCore::Duration&)
        {
            if (kwds != nullptr && PyDict_Size(kwds) > 0) {
                errInfo.reset(kwds);
                Py_INCREF(errInfo.object());
                return Shiboken::returnWrongArguments_MinusOne(args, "__init__", errInfo, SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]);
            }
            break;
        }
        case 2: // Duration::Duration(const QDateTime&,const QDateTime&)
        {
            if (kwds != nullptr && PyDict_Size(kwds) > 0) {
                errInfo.reset(kwds);
                Py_INCREF(errInfo.object());
                return Shiboken::returnWrongArguments_MinusOne(args, "__init__", errInfo, SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]);
            }
            break;
        }
        case 3: // Duration::Duration(const QDateTime&,const QDateTime&,KCalendarCore::Duration::Type)
        {
            if (kwds != nullptr && PyDict_Size(kwds) > 0) {
                errInfo.reset(kwds);
                Py_INCREF(errInfo.object());
                return Shiboken::returnWrongArguments_MinusOne(args, "__init__", errInfo, SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]);
            }
            break;
        }
        case 4: // Duration::Duration(int,KCalendarCore::Duration::Type=)
        {
            if (kwds != nullptr && PyDict_Size(kwds) > 0) {
                static const Shiboken::ArgumentNameIndexMapping mapping[1] = {{"type", 1}};
                if (!Shiboken::parseKeywordArguments(kwds, mapping, 1, errInfo, pyArgs)
                    || (pyArgs[1] != nullptr && !((pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Enum::getConverter(reinterpret_cast<SbkEnumType *>(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_Type_IDX]))), (pyArgs[1])))))) {
                    Py_XINCREF(errInfo.object());
                    return Shiboken::returnWrongArguments_MinusOne(args, "__init__", errInfo, SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]);
                }
            }
            break;
        }
    }

    // PyMI support
    Shiboken::callInheritedInit(self, args, errInfo.isNull() ? kwds : errInfo.object(), SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]);
    if (Shiboken::Errors::occurred() != nullptr)
        return -1;

    // Call function/method
    switch (overloadId) {
        case 0: // Duration()
        {

            // Duration::Duration()
            cptr = new ::KCalendarCore::Duration();
            break;
        }
        case 1: // Duration(const KCalendarCore::Duration &duration)
        {
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return -1;
            ::KCalendarCore::Duration cppArg0_local;
            ::KCalendarCore::Duration *cppArg0 = &cppArg0_local;
            if (pythonToCpp[0].isValue())
                pythonToCpp[0](pyArgs[0], &cppArg0_local);
            else
                pythonToCpp[0](pyArgs[0], &cppArg0);


            if (Shiboken::Errors::occurred() == nullptr) {
                // Duration::Duration(const KCalendarCore::Duration&)
                cptr = new ::KCalendarCore::Duration(*cppArg0);
            }
            break;
        }
        case 2: // Duration(const QDateTime &start, const QDateTime &end)
        {
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return -1;
            ::QDateTime cppArg0_local;
            ::QDateTime *cppArg0 = &cppArg0_local;
            if (pythonToCpp[0].isValue())
                pythonToCpp[0](pyArgs[0], &cppArg0_local);
            else
                pythonToCpp[0](pyArgs[0], &cppArg0);

            if (!Shiboken::Object::isValid(pyArgs[1]))
                return -1;
            ::QDateTime cppArg1_local;
            ::QDateTime *cppArg1 = &cppArg1_local;
            if (pythonToCpp[1].isValue())
                pythonToCpp[1](pyArgs[1], &cppArg1_local);
            else
                pythonToCpp[1](pyArgs[1], &cppArg1);


            if (Shiboken::Errors::occurred() == nullptr) {
                // Duration::Duration(const QDateTime&,const QDateTime&)
                cptr = new ::KCalendarCore::Duration(*cppArg0, *cppArg1);
            }
            break;
        }
        case 3: // Duration(const QDateTime &start, const QDateTime &end, KCalendarCore::Duration::Type type)
        {
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return -1;
            ::QDateTime cppArg0_local;
            ::QDateTime *cppArg0 = &cppArg0_local;
            if (pythonToCpp[0].isValue())
                pythonToCpp[0](pyArgs[0], &cppArg0_local);
            else
                pythonToCpp[0](pyArgs[0], &cppArg0);

            if (!Shiboken::Object::isValid(pyArgs[1]))
                return -1;
            ::QDateTime cppArg1_local;
            ::QDateTime *cppArg1 = &cppArg1_local;
            if (pythonToCpp[1].isValue())
                pythonToCpp[1](pyArgs[1], &cppArg1_local);
            else
                pythonToCpp[1](pyArgs[1], &cppArg1);

            ::KCalendarCore::Duration::Type cppArg2{KCalendarCore::Duration::Seconds};
            pythonToCpp[2](pyArgs[2], &cppArg2);

            if (Shiboken::Errors::occurred() == nullptr) {
                // Duration::Duration(const QDateTime&,const QDateTime&,KCalendarCore::Duration::Type)
                cptr = new ::KCalendarCore::Duration(*cppArg0, *cppArg1, cppArg2);
            }
            break;
        }
        case 4: // Duration(int duration, KCalendarCore::Duration::Type type)
        {
            int cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);
            ::KCalendarCore::Duration::Type cppArg1(KCalendarCore::Duration::Type::Seconds);
            if (pythonToCpp[1])
                pythonToCpp[1](pyArgs[1], &cppArg1);

            if (Shiboken::Errors::occurred() == nullptr) {
                // Duration::Duration(int,KCalendarCore::Duration::Type=)
                cptr = new ::KCalendarCore::Duration(cppArg0, cppArg1);
            }
            break;
        }
    }

    if (Shiboken::Errors::occurred() != nullptr || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::KCalendarCore::Duration >(), cptr)) {
        delete cptr;
        return -1;
    }
    if (cptr == nullptr)
        return Shiboken::returnWrongArguments_MinusOne(args, "__init__", SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]);

    Shiboken::Object::setValidCpp(sbkSelf, true);
    Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr);


    return 1;
}

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

    // Call function/method
    {

        // Duration::asDays()const->int
        int cppResult = const_cast<const ::KCalendarCore::Duration *>(cppSelf)->asDays();
        pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

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

    // Call function/method
    {

        // Duration::asSeconds()const->int
        int cppResult = const_cast<const ::KCalendarCore::Duration *>(cppSelf)->asSeconds();
        pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_KCalendarCore_DurationFunc_end(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCalendarCore::Duration *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp;

    // Overloaded function decisor
    // 0: Duration::end(const QDateTime&)const->QDateTime
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QDateTime_IDX]), (pyArg)))) {
        overloadId = 0; // Duration::end(const QDateTime&)const->QDateTime
    }

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

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::QDateTime cppArg0_local;
        ::QDateTime *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (Shiboken::Errors::occurred() == nullptr) {
            // Duration::end(const QDateTime&)const->QDateTime
            QDateTime cppResult = const_cast<const ::KCalendarCore::Duration *>(cppSelf)->end(*cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QDateTime_IDX]), &cppResult);
        }
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

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

    // Call function/method
    {

        // Duration::isDaily()const->bool
        bool cppResult = const_cast<const ::KCalendarCore::Duration *>(cppSelf)->isDaily();
        pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

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

    // Call function/method
    {

        // Duration::isNull()const->bool
        bool cppResult = const_cast<const ::KCalendarCore::Duration *>(cppSelf)->isNull();
        pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

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

    // Call function/method
    {

        // Duration::type()const->KCalendarCore::Duration::Type
        KCalendarCore::Duration::Type cppResult = const_cast<const ::KCalendarCore::Duration *>(cppSelf)->type();
        pyResult = Shiboken::Conversions::copyToPython(Shiboken::Enum::getConverter(reinterpret_cast<SbkEnumType *>(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_Type_IDX]))), &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

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

    // Call function/method
    {

        // Duration::value()const->int
        int cppResult = const_cast<const ::KCalendarCore::Duration *>(cppSelf)->value();
        pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_KCalendarCore_Duration__copy__(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto &cppSelf = *reinterpret_cast< ::KCalendarCore::Duration *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult = Shiboken::Conversions::copyToPython(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), &cppSelf);
    if (Shiboken::Errors::occurred() != nullptr || pyResult == nullptr) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}


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

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

static PyMethodDef Sbk_KCalendarCore_Duration_methods[] = {
    {"asDays", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_DurationFunc_asDays), METH_NOARGS, nullptr},
    {"asSeconds", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_DurationFunc_asSeconds), METH_NOARGS, nullptr},
    {"end", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_DurationFunc_end), METH_O, nullptr},
    {"isDaily", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_DurationFunc_isDaily), METH_NOARGS, nullptr},
    {"isNull", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_DurationFunc_isNull), METH_NOARGS, nullptr},
    {"type", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_DurationFunc_type), METH_NOARGS, nullptr},
    {"value", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_DurationFunc_value), METH_NOARGS, nullptr},
    {"__copy__", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_Duration__copy__), METH_NOARGS, nullptr},
    {nullptr, nullptr, 0, nullptr} // Sentinel
};

static PyObject *Sbk_KCalendarCore_DurationFunc___mul__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), pyArg)
                    && !SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCalendarCore::Duration *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp;

    // Overloaded function decisor
    // 0: Duration::operator*(int)const->KCalendarCore::Duration
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 0; // Duration::operator*(int)const->KCalendarCore::Duration
    }

    if (isReverse && overloadId == -1) {
        Shiboken::Errors::setReverseOperatorNotImplemented();
        return {};
    }

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

    // Call function/method
    {
        int cppArg0;
        pythonToCpp(pyArg, &cppArg0);

        if (Shiboken::Errors::occurred() == nullptr) {
            // Duration::operator*(int)const->KCalendarCore::Duration
            KCalendarCore::Duration cppResult = (*cppSelf) * cppArg0;
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), &cppResult);
        }
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_KCalendarCore_DurationFunc___imul__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), pyArg)
                    && !SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCalendarCore::Duration *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), reinterpret_cast<SbkObject *>(self)));
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp;

    // Overloaded function decisor
    // 0: Duration::operator*=(int)->KCalendarCore::Duration&
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 0; // Duration::operator*=(int)->KCalendarCore::Duration&
    }

    if (isReverse && overloadId == -1) {
        Shiboken::Errors::setReverseOperatorNotImplemented();
        return {};
    }

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

    // Call function/method
    {
        int cppArg0;
        pythonToCpp(pyArg, &cppArg0);

        if (Shiboken::Errors::occurred() == nullptr) {
            // Duration::operator*=(int)->KCalendarCore::Duration&
            (*cppSelf) *= cppArg0;
        }
    }

    return Sbk_ReturnFromPython_Self(self);
}

static PyObject *Sbk_KCalendarCore_DurationFunc___add__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), pyArg)
                    && !SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCalendarCore::Duration *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp;

    // Overloaded function decisor
    // 0: Duration::operator+(const KCalendarCore::Duration&)const->KCalendarCore::Duration
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), (pyArg)))) {
        overloadId = 0; // Duration::operator+(const KCalendarCore::Duration&)const->KCalendarCore::Duration
    }

    if (isReverse && overloadId == -1) {
        Shiboken::Errors::setReverseOperatorNotImplemented();
        return {};
    }

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

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::KCalendarCore::Duration cppArg0_local;
        ::KCalendarCore::Duration *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (Shiboken::Errors::occurred() == nullptr) {
            // Duration::operator+(const KCalendarCore::Duration&)const->KCalendarCore::Duration
            KCalendarCore::Duration cppResult = (*cppSelf) + (*cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), &cppResult);
        }
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_KCalendarCore_DurationFunc___iadd__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), pyArg)
                    && !SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCalendarCore::Duration *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), reinterpret_cast<SbkObject *>(self)));
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp;

    // Overloaded function decisor
    // 0: Duration::operator+=(const KCalendarCore::Duration&)->KCalendarCore::Duration&
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), (pyArg)))) {
        overloadId = 0; // Duration::operator+=(const KCalendarCore::Duration&)->KCalendarCore::Duration&
    }

    if (isReverse && overloadId == -1) {
        Shiboken::Errors::setReverseOperatorNotImplemented();
        return {};
    }

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

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::KCalendarCore::Duration cppArg0_local;
        ::KCalendarCore::Duration *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (Shiboken::Errors::occurred() == nullptr) {
            // Duration::operator+=(const KCalendarCore::Duration&)->KCalendarCore::Duration&
            (*cppSelf) += (*cppArg0);
        }
    }

    return Sbk_ReturnFromPython_Self(self);
}

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

    // Call function/method
    {

        // Duration::operator-()const->KCalendarCore::Duration
        KCalendarCore::Duration cppResult = - (*cppSelf);
        pyResult = Shiboken::Conversions::copyToPython(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_KCalendarCore_DurationFunc___sub__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), pyArg)
                    && !SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCalendarCore::Duration *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp;

    // Overloaded function decisor
    // 0: Duration::operator-(const KCalendarCore::Duration&)const->KCalendarCore::Duration
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), (pyArg)))) {
        overloadId = 0; // Duration::operator-(const KCalendarCore::Duration&)const->KCalendarCore::Duration
    }

    if (isReverse && overloadId == -1) {
        Shiboken::Errors::setReverseOperatorNotImplemented();
        return {};
    }

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

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::KCalendarCore::Duration cppArg0_local;
        ::KCalendarCore::Duration *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (Shiboken::Errors::occurred() == nullptr) {
            // Duration::operator-(const KCalendarCore::Duration&)const->KCalendarCore::Duration
            KCalendarCore::Duration cppResult = (*cppSelf) - (*cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), &cppResult);
        }
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_KCalendarCore_DurationFunc___isub__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), pyArg)
                    && !SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCalendarCore::Duration *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), reinterpret_cast<SbkObject *>(self)));
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp;

    // Overloaded function decisor
    // 0: Duration::operator-=(const KCalendarCore::Duration&)->KCalendarCore::Duration&
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), (pyArg)))) {
        overloadId = 0; // Duration::operator-=(const KCalendarCore::Duration&)->KCalendarCore::Duration&
    }

    if (isReverse && overloadId == -1) {
        Shiboken::Errors::setReverseOperatorNotImplemented();
        return {};
    }

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

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArg))
            return {};
        ::KCalendarCore::Duration cppArg0_local;
        ::KCalendarCore::Duration *cppArg0 = &cppArg0_local;
        if (pythonToCpp.isValue())
            pythonToCpp(pyArg, &cppArg0_local);
        else
            pythonToCpp(pyArg, &cppArg0);


        if (Shiboken::Errors::occurred() == nullptr) {
            // Duration::operator-=(const KCalendarCore::Duration&)->KCalendarCore::Duration&
            (*cppSelf) -= (*cppArg0);
        }
    }

    return Sbk_ReturnFromPython_Self(self);
}

static PyObject *Sbk_KCalendarCore_DurationFunc___div__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), pyArg)
                    && !SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCalendarCore::Duration *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp;

    // Overloaded function decisor
    // 0: Duration::operator/(int)const->KCalendarCore::Duration
    if (!isReverse
        && (pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 0; // Duration::operator/(int)const->KCalendarCore::Duration
    }

    if (isReverse && overloadId == -1) {
        Shiboken::Errors::setReverseOperatorNotImplemented();
        return {};
    }

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

    // Call function/method
    {
        int cppArg0;
        pythonToCpp(pyArg, &cppArg0);

        if (Shiboken::Errors::occurred() == nullptr) {
            // Duration::operator/(int)const->KCalendarCore::Duration
            KCalendarCore::Duration cppResult = (*cppSelf) / cppArg0;
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), &cppResult);
        }
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_KCalendarCore_DurationFunc___lshift__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), pyArg)
                    && !SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCalendarCore::Duration *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp;

    static PyObject *attrName = Shiboken::PyMagicName::rlshift();
    if (!isReverse
        && Shiboken::Object::checkType(pyArg)
        && !PyObject_TypeCheck(pyArg, self->ob_type)
        && PyObject_HasAttr(pyArg, attrName)) {
        PyObject *revOpMethod = PyObject_GetAttr(pyArg, attrName);
        if (revOpMethod && PyCallable_Check(revOpMethod)) {
            pyResult = PyObject_CallFunction(revOpMethod, "O", self);
            if (Shiboken::Errors::occurred() != nullptr && (PyErr_ExceptionMatches(PyExc_NotImplementedError) || PyErr_ExceptionMatches(PyExc_AttributeError))) {
                PyErr_Clear();
                Py_XDECREF(pyResult);
                pyResult = nullptr;
            }
        }
        Py_XDECREF(revOpMethod);

    }

    // Do not enter here if other object has implemented a reverse operator.
    if (pyResult == nullptr) {
        // Overloaded function decisor
        // 0: Duration::operator<<(QDataStream&)->QDataStream& [free reverse operator]
        if (isReverse
            && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QDataStream_IDX]), (pyArg)))) {
            overloadId = 0; // Duration::operator<<(QDataStream&)->QDataStream& [free reverse operator]
        }

        if (isReverse && overloadId == -1) {
            Shiboken::Errors::setReverseOperatorNotImplemented();
            return {};
        }

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

        // Call function/method
        {
            if (!Shiboken::Object::isValid(pyArg))
                return {};
            ::QDataStream *cppArg0;
            pythonToCpp(pyArg, &cppArg0);

            if (Shiboken::Errors::occurred() == nullptr) {
                // Duration::operator<<(QDataStream&)->QDataStream& [free reverse operator]
                QDataStream & cppResult = (*cppArg0) << (*cppSelf);
                pyResult = Shiboken::Conversions::referenceToPython(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QDataStream_IDX]), &cppResult);
            }
        }

    } // End of "if (!pyResult)"

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_KCalendarCore_DurationFunc___rshift__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), pyArg)
                    && !SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCalendarCore::Duration *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp;

    static PyObject *attrName = Shiboken::PyMagicName::rrshift();
    if (!isReverse
        && Shiboken::Object::checkType(pyArg)
        && !PyObject_TypeCheck(pyArg, self->ob_type)
        && PyObject_HasAttr(pyArg, attrName)) {
        PyObject *revOpMethod = PyObject_GetAttr(pyArg, attrName);
        if (revOpMethod && PyCallable_Check(revOpMethod)) {
            pyResult = PyObject_CallFunction(revOpMethod, "O", self);
            if (Shiboken::Errors::occurred() != nullptr && (PyErr_ExceptionMatches(PyExc_NotImplementedError) || PyErr_ExceptionMatches(PyExc_AttributeError))) {
                PyErr_Clear();
                Py_XDECREF(pyResult);
                pyResult = nullptr;
            }
        }
        Py_XDECREF(revOpMethod);

    }

    // Do not enter here if other object has implemented a reverse operator.
    if (pyResult == nullptr) {
        // Overloaded function decisor
        // 0: Duration::operator>>(QDataStream&)->QDataStream& [free reverse operator]
        if (isReverse
            && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QDataStream_IDX]), (pyArg)))) {
            overloadId = 0; // Duration::operator>>(QDataStream&)->QDataStream& [free reverse operator]
        }

        if (isReverse && overloadId == -1) {
            Shiboken::Errors::setReverseOperatorNotImplemented();
            return {};
        }

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

        // Call function/method
        {
            if (!Shiboken::Object::isValid(pyArg))
                return {};
            ::QDataStream *cppArg0;
            pythonToCpp(pyArg, &cppArg0);

            if (Shiboken::Errors::occurred() == nullptr) {
                // Duration::operator>>(QDataStream&)->QDataStream& [free reverse operator]
                QDataStream & cppResult = (*cppArg0) >> (*cppSelf);
                pyResult = Shiboken::Conversions::referenceToPython(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QDataStream_IDX]), &cppResult);
            }
        }

    } // End of "if (!pyResult)"

    return Sbk_ReturnFromPython_Result(pyResult);
}

// Rich comparison
static PyObject * Sbk_KCalendarCore_Duration_richcompare(PyObject *self, PyObject *pyArg, int op)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto &cppSelf = *reinterpret_cast< ::KCalendarCore::Duration *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    switch (op) {
        case Py_NE:
            if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), (pyArg)))) {
                // Duration::operator!=(const KCalendarCore::Duration&)const->bool
                if (!Shiboken::Object::isValid(pyArg))
                    return {};
                ::KCalendarCore::Duration cppArg0_local;
                ::KCalendarCore::Duration *cppArg0 = &cppArg0_local;
                if (pythonToCpp.isValue())
                    pythonToCpp(pyArg, &cppArg0_local);
                else
                    pythonToCpp(pyArg, &cppArg0);

                bool cppResult = cppSelf != (*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
            } else {
                pyResult = Py_True;
                Py_INCREF(pyResult);
            }

            break;
        case Py_LT:
            if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), (pyArg)))) {
                // Duration::operator<(const KCalendarCore::Duration&)const->bool
                if (!Shiboken::Object::isValid(pyArg))
                    return {};
                ::KCalendarCore::Duration cppArg0_local;
                ::KCalendarCore::Duration *cppArg0 = &cppArg0_local;
                if (pythonToCpp.isValue())
                    pythonToCpp(pyArg, &cppArg0_local);
                else
                    pythonToCpp(pyArg, &cppArg0);

                bool cppResult = cppSelf < (*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
            } else {
                return Shiboken::returnFromRichCompare(pyResult);
            }

            break;
        case Py_LE:
            if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), (pyArg)))) {
                // Duration::operator<=(const KCalendarCore::Duration&)const->bool
                if (!Shiboken::Object::isValid(pyArg))
                    return {};
                ::KCalendarCore::Duration cppArg0_local;
                ::KCalendarCore::Duration *cppArg0 = &cppArg0_local;
                if (pythonToCpp.isValue())
                    pythonToCpp(pyArg, &cppArg0_local);
                else
                    pythonToCpp(pyArg, &cppArg0);

                bool cppResult = cppSelf <= (*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
            } else {
                return Shiboken::returnFromRichCompare(pyResult);
            }

            break;
        case Py_EQ:
            if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), (pyArg)))) {
                // Duration::operator==(const KCalendarCore::Duration&)const->bool
                if (!Shiboken::Object::isValid(pyArg))
                    return {};
                ::KCalendarCore::Duration cppArg0_local;
                ::KCalendarCore::Duration *cppArg0 = &cppArg0_local;
                if (pythonToCpp.isValue())
                    pythonToCpp(pyArg, &cppArg0_local);
                else
                    pythonToCpp(pyArg, &cppArg0);

                bool cppResult = cppSelf == (*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
            } else {
                pyResult = Py_False;
                Py_INCREF(pyResult);
            }

            break;
        case Py_GT:
            if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), (pyArg)))) {
                // Duration::operator>(const KCalendarCore::Duration&)const->bool
                if (!Shiboken::Object::isValid(pyArg))
                    return {};
                ::KCalendarCore::Duration cppArg0_local;
                ::KCalendarCore::Duration *cppArg0 = &cppArg0_local;
                if (pythonToCpp.isValue())
                    pythonToCpp(pyArg, &cppArg0_local);
                else
                    pythonToCpp(pyArg, &cppArg0);

                bool cppResult = cppSelf > (*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
            } else {
                return Shiboken::returnFromRichCompare(pyResult);
            }

            break;
        case Py_GE:
            if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), (pyArg)))) {
                // Duration::operator>=(const KCalendarCore::Duration&)const->bool
                if (!Shiboken::Object::isValid(pyArg))
                    return {};
                ::KCalendarCore::Duration cppArg0_local;
                ::KCalendarCore::Duration *cppArg0 = &cppArg0_local;
                if (pythonToCpp.isValue())
                    pythonToCpp(pyArg, &cppArg0_local);
                else
                    pythonToCpp(pyArg, &cppArg0);

                bool cppResult = cppSelf >= (*cppArg0);
                pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
            } else {
                return Shiboken::returnFromRichCompare(pyResult);
            }

            break;
        default:
            // PYSIDE-74: By default, we redirect to object's tp_richcompare (which is `==`, `!=`).
            return FallbackRichCompare(self, pyArg, op);
    }

    return Shiboken::returnFromRichCompare(pyResult);
}

} // extern "C"

static int Sbk_KCalendarCore_Duration_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_Duration_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_Duration_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_KCalendarCore_Duration_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_KCalendarCore_Duration_clear)},
    {Py_tp_richcompare, reinterpret_cast<void *>(Sbk_KCalendarCore_Duration_richcompare)},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_KCalendarCore_Duration_methods)},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_KCalendarCore_Duration_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObject_tp_new)},
    // type supports number protocol
    {Py_nb_inplace_add, reinterpret_cast<void *>(Sbk_KCalendarCore_DurationFunc___iadd__)},
    {Py_nb_subtract,    reinterpret_cast<void *>(Sbk_KCalendarCore_DurationFunc___sub__)},
    {Py_nb_inplace_multiply,reinterpret_cast<void *>(Sbk_KCalendarCore_DurationFunc___imul__)},
    {Py_nb_multiply,    reinterpret_cast<void *>(Sbk_KCalendarCore_DurationFunc___mul__)},
    {Py_nb_negative,    reinterpret_cast<void *>(Sbk_KCalendarCore_DurationFunc___neg__)},
    {Py_nb_inplace_subtract,reinterpret_cast<void *>(Sbk_KCalendarCore_DurationFunc___isub__)},
    {Py_nb_lshift,      reinterpret_cast<void *>(Sbk_KCalendarCore_DurationFunc___lshift__)},
    {Py_nb_rshift,      reinterpret_cast<void *>(Sbk_KCalendarCore_DurationFunc___rshift__)},
    {Py_nb_true_divide, reinterpret_cast<void *>(Sbk_KCalendarCore_DurationFunc___div__)},
    {Py_nb_add,         reinterpret_cast<void *>(Sbk_KCalendarCore_DurationFunc___add__)},
    {0, nullptr}
};
static PyType_Spec Sbk_KCalendarCore_Duration_spec = {
    "1:KCalendarCore.KCalendarCore.Duration",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_KCalendarCore_Duration_slots
};

} //extern "C"

// Type conversion functions.

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

}
static PythonToCppFunc is_Enum_PythonToCpp_KCalendarCore_Duration_Type_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_Type_IDX])))
        return Enum_PythonToCpp_KCalendarCore_Duration_Type;
    return {};
}

static PyObject *KCalendarCore_Duration_Type_CppToPython_Enum(PyTypeObject *pyType, const void *cppIn)
{
    using IntType = std::underlying_type_t<::KCalendarCore::Duration::Type>;
    const auto castCppIn = IntType(*reinterpret_cast<const ::KCalendarCore::Duration::Type *>(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 Duration_PythonToCpp_Duration_PTR(PyObject *pyIn, void *cppOut)
{
    Shiboken::Conversions::pythonToCppPointer(Sbk_KCalendarCore_Duration_TypeF(), pyIn, cppOut);
}
static PythonToCppFunc is_Duration_PythonToCpp_Duration_PTR_Convertible(PyObject *pyIn)
{
    if (pyIn == Py_None)
        return Shiboken::Conversions::nonePythonToCppNullPtr;
    if (PyObject_TypeCheck(pyIn, Sbk_KCalendarCore_Duration_TypeF()))
        return Duration_PythonToCpp_Duration_PTR;
    return {};
}

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

}

// C++ to Python copy conversion.
static PyObject *Duration_COPY_CppToPython_Duration(const void *cppIn)
{
    auto *source = reinterpret_cast<const ::KCalendarCore::Duration *>(cppIn);
    return Shiboken::Object::newObject(Sbk_KCalendarCore_Duration_TypeF(), new ::KCalendarCore::Duration(*source), true, true);
}

// Python to C++ copy conversion.
static void Duration_PythonToCpp_Duration_COPY(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::KCalendarCore::Duration *>(cppOut) = *reinterpret_cast< ::KCalendarCore::Duration *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), reinterpret_cast<SbkObject *>(pyIn)));
}
static PythonToCppFunc is_Duration_PythonToCpp_Duration_COPY_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, Sbk_KCalendarCore_Duration_TypeF()))
        return Duration_PythonToCpp_Duration_COPY;
    return {};
}

// Implicit conversions.
static void int_PythonToCpp_KCalendarCore_Duration(PyObject *pyIn, void *cppOut)
{
    int cppIn;
    Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter<int>(), pyIn, &cppIn);
    *reinterpret_cast<::KCalendarCore::Duration *>(cppOut) = ::KCalendarCore::Duration(cppIn);
}
static PythonToCppFunc is_int_PythonToCpp_KCalendarCore_Duration_Convertible(PyObject *pyIn)
{
    if (PyLong_Check(pyIn))
        return int_PythonToCpp_KCalendarCore_Duration;
    return {};
}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
#if PYSIDE6_COMOPT_COMPRESS == 0
static const char *KCalendarCore_Duration_SignatureStrings[] = {
    "4:KCalendarCore.KCalendarCore.Duration(self)",
    "3:KCalendarCore.KCalendarCore.Duration(self,duration:KCalendarCore.KCalendarCore.Duration)",
    "2:KCalendarCore.KCalendarCore.Duration(self,start:PySide6.QtCore.QDateTime,end:PySide6.QtCore.QDateTime)",
    "1:KCalendarCore.KCalendarCore.Duration(self,start:PySide6.QtCore.QDateTime,end:PySide6.QtCore.QDateTime,type:KCalendarCore.KCalendarCore.Duration.Type)",
    "0:KCalendarCore.KCalendarCore.Duration(self,duration:int,type:KCalendarCore.KCalendarCore.Duration.Type=KCalendarCore.Duration.Type.Seconds)",
    "KCalendarCore.KCalendarCore.Duration.asDays(self)->int",
    "KCalendarCore.KCalendarCore.Duration.asSeconds(self)->int",
    "KCalendarCore.KCalendarCore.Duration.end(self,start:PySide6.QtCore.QDateTime)->PySide6.QtCore.QDateTime",
    "KCalendarCore.KCalendarCore.Duration.isDaily(self)->bool",
    "KCalendarCore.KCalendarCore.Duration.isNull(self)->bool",
    "KCalendarCore.KCalendarCore.Duration.type(self)->KCalendarCore.KCalendarCore.Duration.Type",
    "KCalendarCore.KCalendarCore.Duration.value(self)->int",
    "KCalendarCore.KCalendarCore.Duration.__copy__(self)->typing._Self",
    "KCalendarCore.KCalendarCore.Duration.__mul__(self,value:int)->KCalendarCore.KCalendarCore.Duration",
    "KCalendarCore.KCalendarCore.Duration.__imul__(self,value:int)->KCalendarCore.KCalendarCore.Duration",
    "KCalendarCore.KCalendarCore.Duration.__add__(self,other:typing.Union[KCalendarCore.KCalendarCore.Duration, int])->KCalendarCore.KCalendarCore.Duration",
    "KCalendarCore.KCalendarCore.Duration.__iadd__(self,other:typing.Union[KCalendarCore.KCalendarCore.Duration, int])->KCalendarCore.KCalendarCore.Duration",
    "KCalendarCore.KCalendarCore.Duration.__neg__(self)->KCalendarCore.KCalendarCore.Duration",
    "KCalendarCore.KCalendarCore.Duration.__sub__(self,other:typing.Union[KCalendarCore.KCalendarCore.Duration, int])->KCalendarCore.KCalendarCore.Duration",
    "KCalendarCore.KCalendarCore.Duration.__isub__(self,other:typing.Union[KCalendarCore.KCalendarCore.Duration, int])->KCalendarCore.KCalendarCore.Duration",
    "KCalendarCore.KCalendarCore.Duration.__div__(self,value:int)->KCalendarCore.KCalendarCore.Duration",
    "KCalendarCore.KCalendarCore.Duration.__lshift__(self,out:PySide6.QtCore.QDataStream)->PySide6.QtCore.QDataStream",
    "KCalendarCore.KCalendarCore.Duration.__rshift__(self,in:PySide6.QtCore.QDataStream)->PySide6.QtCore.QDataStream",
    "KCalendarCore.KCalendarCore.Duration.__ne__(self,other:typing.Union[KCalendarCore.KCalendarCore.Duration, int])->bool",
    "KCalendarCore.KCalendarCore.Duration.__lt__(self,other:typing.Union[KCalendarCore.KCalendarCore.Duration, int])->bool",
    "KCalendarCore.KCalendarCore.Duration.__le__(self,other:typing.Union[KCalendarCore.KCalendarCore.Duration, int])->bool",
    "KCalendarCore.KCalendarCore.Duration.__eq__(self,other:typing.Union[KCalendarCore.KCalendarCore.Duration, int])->bool",
    "KCalendarCore.KCalendarCore.Duration.__gt__(self,other:typing.Union[KCalendarCore.KCalendarCore.Duration, int])->bool",
    "KCalendarCore.KCalendarCore.Duration.__ge__(self,other:typing.Union[KCalendarCore.KCalendarCore.Duration, int])->bool",
    nullptr}; // Sentinel
#else
static constexpr size_t KCalendarCore_Duration_SignatureByteSize = 336;
static constexpr uint8_t KCalendarCore_Duration_SignatureBytes[336] = {
    0x78, 0xda, 0xcd, 0x55, 0x4b, 0x4b, 0xc3, 0x40, 0x10, 0xbe, 0xe7, 0x57, 0x78, 0x74, 0x21, 0x06,
    0x5f, 0x78, 0x08, 0xe8, 0xa5, 0xb9, 0x09, 0x62, 0x49, 0x3d, 0x89, 0x84, 0x69, 0x77, 0x9a, 0x2e,
    0x6c, 0x76, 0xeb, 0x3e, 0x0a, 0xf9, 0xf7, 0x6e, 0x6b, 0xa2, 0x14, 0x5a, 0x99, 0x48, 0xda, 0xe4,
    0xb8, 0x3b, 0xf3, 0x3d, 0xe6, 0x91, 0xcd, 0x7d, 0xfa, 0x3c, 0x01, 0x89, 0x8a, 0x83, 0x99, 0x68,
    0x83, 0xc9, 0xfe, 0x29, 0xf3, 0x06, 0x9c, 0xd0, 0xea, 0xd2, 0xa2, 0x5c, 0xb2, 0xe8, 0x8e, 0x9e,
    0x1c, 0xf3, 0xe6, 0x44, 0x82, 0xb0, 0xe8, 0xb6, 0x03, 0xb5, 0x75, 0x60, 0x5c, 0xfa, 0x5a, 0xe7,
    0x82, 0xe3, 0x43, 0x32, 0x75, 0xbb, 0x94, 0x69, 0x06, 0x0e, 0x67, 0xa2, 0xc2, 0x38, 0xc0, 0x8e,
    0x06, 0x59, 0x74, 0x73, 0x1e, 0xa1, 0xd8, 0xd5, 0x6b, 0x24, 0x49, 0x25, 0xb3, 0x90, 0xc9, 0xa2,
    0xeb, 0xff, 0xf4, 0x56, 0x28, 0xd7, 0x51, 0xe8, 0xf1, 0x8f, 0x58, 0x92, 0xe3, 0x42, 0x2b, 0x6e,
    0x59, 0x44, 0xa2, 0x03, 0x9b, 0x41, 0x6d, 0xbf, 0x57, 0xe3, 0xea, 0x29, 0x58, 0xa1, 0xc2, 0x1a,
    0x99, 0xce, 0xc8, 0x70, 0x45, 0x99, 0x4b, 0xa0, 0x3c, 0x16, 0xa2, 0xe9, 0x88, 0x50, 0x98, 0x90,
    0x75, 0xeb, 0x6f, 0xae, 0xb5, 0xa4, 0x02, 0x5f, 0xbc, 0x94, 0xdd, 0x71, 0xdb, 0x11, 0xb6, 0x28,
    0xf2, 0x24, 0x69, 0xd4, 0x1b, 0x90, 0x1e, 0x3b, 0x77, 0xba, 0x28, 0x16, 0x7a, 0x5d, 0x17, 0x45,
    0x0b, 0x0c, 0x06, 0x85, 0x2a, 0x93, 0x22, 0x0f, 0x47, 0x2a, 0x43, 0xe5, 0x65, 0x43, 0x10, 0xef,
    0x4c, 0x6c, 0x97, 0x95, 0x58, 0x1f, 0x55, 0x42, 0x9c, 0x41, 0x03, 0x38, 0x6f, 0x25, 0xb4, 0x5b,
    0xa1, 0x49, 0x9b, 0x5e, 0xbc, 0xa9, 0x10, 0x7f, 0xa7, 0x90, 0xc4, 0x17, 0xc1, 0xd5, 0x47, 0xdf,
    0xa5, 0x8f, 0xd4, 0x97, 0xc2, 0xf2, 0x77, 0x6d, 0xfa, 0x24, 0xb6, 0x7e, 0x3e, 0xca, 0x39, 0x8c,
    0xd4, 0x17, 0x17, 0x9b, 0x53, 0x7f, 0x19, 0xd2, 0xae, 0xc4, 0xd2, 0xfd, 0x14, 0xef, 0x0f, 0xbe,
    0xc8, 0x90, 0x3b, 0x83, 0x50, 0x1d, 0x7e, 0x93, 0x9b, 0x20, 0x55, 0xd0, 0xec, 0x09, 0x0a, 0x75,
    0x6a, 0x3d, 0x85, 0x7d, 0x4d, 0x96, 0xfe, 0x2b, 0x08, 0x6d, 0x75, 0x83, 0xa8, 0x0e, 0x52, 0x2b,
    0x7e, 0x0e, 0xa1, 0x5a, 0x0e, 0xd2, 0xe1, 0xb2, 0xdf, 0x0e, 0x7f, 0x01, 0xa0, 0x55, 0x44, 0xdf
};
#endif

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

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

    PyTypeObject *pyType = Shiboken::ObjectType::introduceWrapperType(
        enclosingClass,
        "Duration",
        "KCalendarCore::Duration",
        &Sbk_KCalendarCore_Duration_spec,
        &Shiboken::callCppDestructor< ::KCalendarCore::Duration >,
        Sbk_KCalendarCore_Duration_Type_bases.object(),
        Shiboken::ObjectType::WrapperFlags::InnerClass | Shiboken::ObjectType::WrapperFlags::Value);
#if PYSIDE6_COMOPT_COMPRESS == 0
    InitSignatureStrings(pyType, KCalendarCore_Duration_SignatureStrings);
#else
    InitSignatureBytes(pyType, KCalendarCore_Duration_SignatureBytes, KCalendarCore_Duration_SignatureByteSize);
#endif
    SbkObjectType_SetPropertyStrings(pyType, Sbk_KCalendarCore_Duration_PropertyStrings);
    typeStruct.type = pyType;

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(pyType,
        Duration_PythonToCpp_Duration_PTR,
        is_Duration_PythonToCpp_Duration_PTR_Convertible,
        Duration_PTR_CppToPython_Duration,
        Duration_COPY_CppToPython_Duration);

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

    // Add Python to C++ copy (value, not pointer neither reference) conversion to type converter.
    Shiboken::Conversions::addPythonToCppValueConversion(converter,
        Duration_PythonToCpp_Duration_COPY,
        is_Duration_PythonToCpp_Duration_COPY_Convertible);
    // Add implicit conversions to type converter.
    Shiboken::Conversions::addPythonToCppValueConversion(converter,
        int_PythonToCpp_KCalendarCore_Duration,
        is_int_PythonToCpp_KCalendarCore_Duration_Convertible);

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

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

    // Initialization of enum 'Type'.
    const char *Type_Initializer[] = {
        "Seconds",
        "Days",
        nullptr};
    // "uint8_t" used instead of "unsigned int"
    constexpr uint8_t Type_InitializerValues[] = {
        uint8_t(KCalendarCore::Duration::Type::Seconds), //  0x00  0
        uint8_t(KCalendarCore::Duration::Type::Days)     //  0x01  1
        };
    EType = Shiboken::Enum::createPythonEnum(pyType,
        "1:KCalendarCore.KCalendarCore.Duration.Type",
        Type_Initializer, Type_InitializerValues);
    SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_Type_IDX].type = EType;
    // Register converter for enum 'KCalendarCore::Duration::Type'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(EType,
            KCalendarCore_Duration_Type_CppToPython_Enum);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            Enum_PythonToCpp_KCalendarCore_Duration_Type,
            is_Enum_PythonToCpp_KCalendarCore_Duration_Type_Convertible);
        Shiboken::Conversions::registerConverterName(converter, "KCalendarCore::Duration::Type");
        Shiboken::Conversions::registerConverterAlias(converter, "Duration::Type");
        Shiboken::Conversions::registerConverterAlias(converter, "Type");
        Shiboken::Enum::setTypeConverter(EType, converter, nullptr);
    }
    // End of 'Type' enum.

    qRegisterMetaType< ::KCalendarCore::Duration >("Duration");
    qRegisterMetaType< ::KCalendarCore::Duration >("KCalendarCore::Duration");
    qRegisterMetaType< ::KCalendarCore::Duration::Type >("Duration::Type");
    qRegisterMetaType< ::KCalendarCore::Duration::Type >("KCalendarCore::Duration::Type");

    return pyType;
}
