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

// Argument includes
#include <QString>
#include <duration.h>
#include <freebusyperiod.h>
#include <period.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_FreeBusyPeriod_TypeF(void)
{
    return SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_FreeBusyPeriod_IDX].type;
}
} // extern "C"


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

extern "C" {
static int
Sbk_KCalendarCore_FreeBusyPeriod_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::FreeBusyPeriod >()))
        return -1;

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

    // invalid argument lengths

    if (PyArg_UnpackTuple(args, "FreeBusyPeriod", 0, 2, &(pyArgs[0]), &(pyArgs[1])) == 0)
        return -1;


    // Overloaded function decisor
    // 0: FreeBusyPeriod::FreeBusyPeriod()
    // 1: FreeBusyPeriod::FreeBusyPeriod(const KCalendarCore::FreeBusyPeriod&)
    // 2: FreeBusyPeriod::FreeBusyPeriod(const KCalendarCore::Period&)
    // 3: FreeBusyPeriod::FreeBusyPeriod(const QDateTime&,const KCalendarCore::Duration&)
    // 4: FreeBusyPeriod::FreeBusyPeriod(const QDateTime&,const QDateTime&)
    if (numArgs == 0) {
        overloadId = 0; // FreeBusyPeriod()
    } else if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QDateTime_IDX]), (pyArgs[0])))) {
        if (numArgs == 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QDateTime_IDX]), (pyArgs[1])))) {
            overloadId = 4; // FreeBusyPeriod::FreeBusyPeriod(const QDateTime&,const QDateTime&)
        } else if (numArgs == 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Duration_IDX]), (pyArgs[1])))) {
            overloadId = 3; // FreeBusyPeriod::FreeBusyPeriod(const QDateTime&,const KCalendarCore::Duration&)
        }
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Period_IDX]), (pyArgs[0])))) {
        overloadId = 2; // FreeBusyPeriod::FreeBusyPeriod(const KCalendarCore::Period&)
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_FreeBusyPeriod_IDX]), (pyArgs[0])))) {
        overloadId = 1; // FreeBusyPeriod::FreeBusyPeriod(const KCalendarCore::FreeBusyPeriod&)
    }

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


    // PyMI support
    Shiboken::callInheritedInit(self, args, kwds, SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_FreeBusyPeriod_IDX]);
    if (Shiboken::Errors::occurred() != nullptr)
        return -1;

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

            // FreeBusyPeriod::FreeBusyPeriod()
            cptr = new ::KCalendarCore::FreeBusyPeriod();
            break;
        }
        case 1: // FreeBusyPeriod(const KCalendarCore::FreeBusyPeriod &period)
        {
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return -1;
            ::KCalendarCore::FreeBusyPeriod *cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);

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


            if (Shiboken::Errors::occurred() == nullptr) {
                // FreeBusyPeriod::FreeBusyPeriod(const KCalendarCore::Period&)
                cptr = new ::KCalendarCore::FreeBusyPeriod(*cppArg0);
            }
            break;
        }
        case 3: // FreeBusyPeriod(const QDateTime &start, const KCalendarCore::Duration &duration)
        {
            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;
            ::KCalendarCore::Duration cppArg1_local;
            ::KCalendarCore::Duration *cppArg1 = &cppArg1_local;
            if (pythonToCpp[1].isValue())
                pythonToCpp[1](pyArgs[1], &cppArg1_local);
            else
                pythonToCpp[1](pyArgs[1], &cppArg1);


            if (Shiboken::Errors::occurred() == nullptr) {
                // FreeBusyPeriod::FreeBusyPeriod(const QDateTime&,const KCalendarCore::Duration&)
                cptr = new ::KCalendarCore::FreeBusyPeriod(*cppArg0, *cppArg1);
            }
            break;
        }
        case 4: // FreeBusyPeriod(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) {
                // FreeBusyPeriod::FreeBusyPeriod(const QDateTime&,const QDateTime&)
                cptr = new ::KCalendarCore::FreeBusyPeriod(*cppArg0, *cppArg1);
            }
            break;
        }
    }

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

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


    return 1;
}

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

    // Call function/method
    {

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

    return Sbk_ReturnFromPython_Result(pyResult);
}

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

    // Overloaded function decisor
    // 0: FreeBusyPeriod::setLocation(const QString&)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QString_IDX], (pyArg)))) {
        overloadId = 0; // FreeBusyPeriod::setLocation(const QString&)
    }

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

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

        if (Shiboken::Errors::occurred() == nullptr) {
            // FreeBusyPeriod::setLocation(const QString&)
            cppSelf->setLocation(cppArg0);
        }
    }

     return Sbk_ReturnFromPython_None();
}

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

    // Overloaded function decisor
    // 0: FreeBusyPeriod::setSummary(const QString&)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QString_IDX], (pyArg)))) {
        overloadId = 0; // FreeBusyPeriod::setSummary(const QString&)
    }

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

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

        if (Shiboken::Errors::occurred() == nullptr) {
            // FreeBusyPeriod::setSummary(const QString&)
            cppSelf->setSummary(cppArg0);
        }
    }

     return Sbk_ReturnFromPython_None();
}

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

    // Overloaded function decisor
    // 0: FreeBusyPeriod::setType(KCalendarCore::FreeBusyPeriod::FreeBusyType)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Enum::getConverter(reinterpret_cast<SbkEnumType *>(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_FreeBusyPeriod_FreeBusyType_IDX]))), (pyArg)))) {
        overloadId = 0; // FreeBusyPeriod::setType(KCalendarCore::FreeBusyPeriod::FreeBusyType)
    }

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

    // Call function/method
    {
        ::KCalendarCore::FreeBusyPeriod::FreeBusyType cppArg0{KCalendarCore::FreeBusyPeriod::Free};
        pythonToCpp(pyArg, &cppArg0);

        if (Shiboken::Errors::occurred() == nullptr) {
            // FreeBusyPeriod::setType(KCalendarCore::FreeBusyPeriod::FreeBusyType)
            cppSelf->setType(cppArg0);
        }
    }

     return Sbk_ReturnFromPython_None();
}

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

    // Call function/method
    {

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

    return Sbk_ReturnFromPython_Result(pyResult);
}

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

    // Call function/method
    {

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

    return Sbk_ReturnFromPython_Result(pyResult);
}


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

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

static PyMethodDef Sbk_KCalendarCore_FreeBusyPeriod_methods[] = {
    {"location", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_FreeBusyPeriodFunc_location), METH_NOARGS, nullptr},
    {"setLocation", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_FreeBusyPeriodFunc_setLocation), METH_O, nullptr},
    {"setSummary", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_FreeBusyPeriodFunc_setSummary), METH_O, nullptr},
    {"setType", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_FreeBusyPeriodFunc_setType), METH_O, nullptr},
    {"summary", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_FreeBusyPeriodFunc_summary), METH_NOARGS, nullptr},
    {"type", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_FreeBusyPeriodFunc_type), METH_NOARGS, nullptr},
    {nullptr, nullptr, 0, nullptr} // Sentinel
};

static PyObject *Sbk_KCalendarCore_FreeBusyPeriodFunc___lshift__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_FreeBusyPeriod_IDX]), pyArg)
                    && !SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_FreeBusyPeriod_IDX]), self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCalendarCore::FreeBusyPeriod *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_FreeBusyPeriod_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: Period::operator<<(QDataStream&)->QDataStream& [free reverse operator]
        if (isReverse
            && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QDataStream_IDX]), (pyArg)))) {
            overloadId = 0; // Period::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_FreeBusyPeriod_IDX]);

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

            if (Shiboken::Errors::occurred() == nullptr) {
                // Period::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_FreeBusyPeriodFunc___rshift__(PyObject *self, PyObject *pyArg)
{
    bool isReverse = SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_FreeBusyPeriod_IDX]), pyArg)
                    && !SbkObject_TypeCheck(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_FreeBusyPeriod_IDX]), self);
    if (isReverse)
        std::swap(self, pyArg);
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCalendarCore::FreeBusyPeriod *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_FreeBusyPeriod_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: Period::operator>>(QDataStream&)->QDataStream& [free reverse operator]
        if (isReverse
            && (pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QDataStream_IDX]), (pyArg)))) {
            overloadId = 0; // Period::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_FreeBusyPeriod_IDX]);

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

            if (Shiboken::Errors::occurred() == nullptr) {
                // Period::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);
}

} // extern "C"

static int Sbk_KCalendarCore_FreeBusyPeriod_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_FreeBusyPeriod_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_FreeBusyPeriod_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_KCalendarCore_FreeBusyPeriod_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_KCalendarCore_FreeBusyPeriod_clear)},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_KCalendarCore_FreeBusyPeriod_methods)},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_KCalendarCore_FreeBusyPeriod_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObject_tp_new)},
    // type supports number protocol
    {Py_nb_lshift,      reinterpret_cast<void *>(Sbk_KCalendarCore_FreeBusyPeriodFunc___lshift__)},
    {Py_nb_rshift,      reinterpret_cast<void *>(Sbk_KCalendarCore_FreeBusyPeriodFunc___rshift__)},
    {0, nullptr}
};
static PyType_Spec Sbk_KCalendarCore_FreeBusyPeriod_spec = {
    "1:KCalendarCore.KCalendarCore.FreeBusyPeriod",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_KCalendarCore_FreeBusyPeriod_slots
};

} //extern "C"

// Type conversion functions.

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

}
static PythonToCppFunc is_Enum_PythonToCpp_KCalendarCore_FreeBusyPeriod_FreeBusyType_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_FreeBusyPeriod_FreeBusyType_IDX])))
        return Enum_PythonToCpp_KCalendarCore_FreeBusyPeriod_FreeBusyType;
    return {};
}

static PyObject *KCalendarCore_FreeBusyPeriod_FreeBusyType_CppToPython_Enum(PyTypeObject *pyType, const void *cppIn)
{
    using IntType = std::underlying_type_t<::KCalendarCore::FreeBusyPeriod::FreeBusyType>;
    const auto castCppIn = IntType(*reinterpret_cast<const ::KCalendarCore::FreeBusyPeriod::FreeBusyType *>(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 FreeBusyPeriod_PythonToCpp_FreeBusyPeriod_PTR(PyObject *pyIn, void *cppOut)
{
    Shiboken::Conversions::pythonToCppPointer(Sbk_KCalendarCore_FreeBusyPeriod_TypeF(), pyIn, cppOut);
}
static PythonToCppFunc is_FreeBusyPeriod_PythonToCpp_FreeBusyPeriod_PTR_Convertible(PyObject *pyIn)
{
    if (pyIn == Py_None)
        return Shiboken::Conversions::nonePythonToCppNullPtr;
    if (PyObject_TypeCheck(pyIn, Sbk_KCalendarCore_FreeBusyPeriod_TypeF()))
        return FreeBusyPeriod_PythonToCpp_FreeBusyPeriod_PTR;
    return {};
}

// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity).
static PyObject *FreeBusyPeriod_PTR_CppToPython_FreeBusyPeriod(const void *cppIn)
{
    auto *pyOut = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(cppIn, Sbk_KCalendarCore_FreeBusyPeriod_TypeF()));
    if (pyOut) {
        Py_INCREF(pyOut);
        return pyOut;
    }
    return Shiboken::Object::newObjectWithHeuristics(Sbk_KCalendarCore_FreeBusyPeriod_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_FreeBusyPeriod_SignatureStrings[] = {
    "4:KCalendarCore.KCalendarCore.FreeBusyPeriod(self)",
    "3:KCalendarCore.KCalendarCore.FreeBusyPeriod(self,period:KCalendarCore.KCalendarCore.FreeBusyPeriod)",
    "2:KCalendarCore.KCalendarCore.FreeBusyPeriod(self,period:KCalendarCore.KCalendarCore.Period)",
    "1:KCalendarCore.KCalendarCore.FreeBusyPeriod(self,start:PySide6.QtCore.QDateTime,duration:typing.Union[KCalendarCore.KCalendarCore.Duration, int])",
    "0:KCalendarCore.KCalendarCore.FreeBusyPeriod(self,start:PySide6.QtCore.QDateTime,end:PySide6.QtCore.QDateTime)",
    "KCalendarCore.KCalendarCore.FreeBusyPeriod.location(self)->QString",
    "KCalendarCore.KCalendarCore.FreeBusyPeriod.setLocation(self,location:QString)",
    "KCalendarCore.KCalendarCore.FreeBusyPeriod.setSummary(self,summary:QString)",
    "KCalendarCore.KCalendarCore.FreeBusyPeriod.setType(self,type:KCalendarCore.KCalendarCore.FreeBusyPeriod.FreeBusyType)",
    "KCalendarCore.KCalendarCore.FreeBusyPeriod.summary(self)->QString",
    "KCalendarCore.KCalendarCore.FreeBusyPeriod.type(self)->KCalendarCore.KCalendarCore.FreeBusyPeriod.FreeBusyType",
    "KCalendarCore.KCalendarCore.FreeBusyPeriod.__lshift__(self,stream:PySide6.QtCore.QDataStream)->PySide6.QtCore.QDataStream",
    "KCalendarCore.KCalendarCore.FreeBusyPeriod.__rshift__(self,stream:PySide6.QtCore.QDataStream)->PySide6.QtCore.QDataStream",
    nullptr}; // Sentinel
#else
static constexpr size_t KCalendarCore_FreeBusyPeriod_SignatureByteSize = 250;
static constexpr uint8_t KCalendarCore_FreeBusyPeriod_SignatureBytes[250] = {
    0x78, 0xda, 0xb5, 0x92, 0x4f, 0x8b, 0xc2, 0x30, 0x10, 0xc5, 0xef, 0xfd, 0x14, 0x1e, 0x0d, 0xd4,
    0xb2, 0xae, 0xe2, 0xa1, 0x07, 0x0f, 0x2a, 0x5e, 0xdc, 0x83, 0xa5, 0x7a, 0x5a, 0xa4, 0x04, 0x3b,
    0xae, 0x81, 0x36, 0x2d, 0x93, 0xe9, 0x21, 0xdf, 0xde, 0xd8, 0x3f, 0x8b, 0xc2, 0xba, 0x38, 0x45,
    0x6f, 0x19, 0x26, 0xef, 0xf7, 0x5e, 0x66, 0x32, 0x0d, 0x37, 0x4b, 0x99, 0x81, 0x4e, 0x25, 0x2e,
    0x0b, 0x84, 0xe0, 0xbe, 0x5a, 0x23, 0xc0, 0xa2, 0x32, 0x76, 0x0b, 0xa8, 0x8a, 0x74, 0x68, 0x20,
    0x3b, 0x09, 0x6f, 0xc2, 0x95, 0xf8, 0x65, 0x7d, 0x66, 0xc8, 0x84, 0xf7, 0xf9, 0x0e, 0x93, 0x0e,
    0x3e, 0x66, 0xc3, 0x0d, 0x49, 0xa4, 0x70, 0x6b, 0x63, 0x95, 0xc2, 0x2c, 0x88, 0xa8, 0xbe, 0x18,
    0xad, 0x24, 0xc1, 0x4e, 0xe5, 0xe0, 0xa7, 0x15, 0x4a, 0x52, 0x85, 0x0e, 0xc9, 0x96, 0x4a, 0xff,
    0x04, 0x7b, 0xed, 0x8a, 0xef, 0xff, 0x4c, 0x56, 0xad, 0xc2, 0x1f, 0x28, 0x4d, 0x07, 0xe1, 0x7d,
    0xbc, 0x3a, 0x92, 0x13, 0x3f, 0x6c, 0x0a, 0xef, 0x79, 0xb3, 0x20, 0x2b, 0x8e, 0x75, 0xd2, 0x66,
    0xfb, 0xa3, 0x79, 0x14, 0x13, 0xba, 0x37, 0x72, 0x10, 0x06, 0xe8, 0xeb, 0x96, 0xe2, 0x77, 0xcc,
    0xb0, 0x85, 0x09, 0x26, 0x2d, 0xae, 0xf2, 0x5c, 0xa2, 0x6d, 0x07, 0xd1, 0x14, 0x7d, 0x59, 0x3b,
    0x5b, 0x42, 0x03, 0x72, 0xcb, 0x03, 0xc6, 0x1a, 0x7e, 0xcb, 0x2b, 0x81, 0xe7, 0x7a, 0x13, 0xbf,
    0xdf, 0x44, 0xa9, 0x0b, 0xed, 0xe4, 0x3d, 0x13, 0x73, 0xec, 0x92, 0x24, 0x33, 0x67, 0x75, 0xa2,
    0x24, 0xe9, 0xfe, 0x1e, 0x82, 0xcc, 0xff, 0xfa, 0x5f, 0x32, 0xae, 0x5b, 0x2e, 0xd6, 0xe3, 0x26,
    0xcf, 0x19, 0x5f, 0xe9, 0x7c, 0x01, 0x4f, 0x37, 0xcc, 0xfa
};
#endif

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

    auto *base1 = reinterpret_cast<PyObject *>(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Period_IDX]));
    Shiboken::AutoDecRef Sbk_KCalendarCore_FreeBusyPeriod_Type_bases(PyTuple_Pack(1, base1));

    PyTypeObject *pyType = Shiboken::ObjectType::introduceWrapperType(
        enclosingClass,
        "FreeBusyPeriod",
        "KCalendarCore::FreeBusyPeriod*",
        &Sbk_KCalendarCore_FreeBusyPeriod_spec,
        &Shiboken::callCppDestructor< ::KCalendarCore::FreeBusyPeriod >,
        Sbk_KCalendarCore_FreeBusyPeriod_Type_bases.object(),
        Shiboken::ObjectType::WrapperFlags::InnerClass);
#if PYSIDE6_COMOPT_COMPRESS == 0
    InitSignatureStrings(pyType, KCalendarCore_FreeBusyPeriod_SignatureStrings);
#else
    InitSignatureBytes(pyType, KCalendarCore_FreeBusyPeriod_SignatureBytes, KCalendarCore_FreeBusyPeriod_SignatureByteSize);
#endif
    SbkObjectType_SetPropertyStrings(pyType, Sbk_KCalendarCore_FreeBusyPeriod_PropertyStrings);
    typeStruct.type = pyType;

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(pyType,
        FreeBusyPeriod_PythonToCpp_FreeBusyPeriod_PTR,
        is_FreeBusyPeriod_PythonToCpp_FreeBusyPeriod_PTR_Convertible,
        FreeBusyPeriod_PTR_CppToPython_FreeBusyPeriod);

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

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

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

    // Initialization of enum 'FreeBusyType'.
    const char *FreeBusyType_Initializer[] = {
        "Free",
        "Busy",
        "BusyUnavailable",
        "BusyTentative",
        "Unknown",
        nullptr};
    // "uint8_t" used instead of "unsigned int"
    constexpr uint8_t FreeBusyType_InitializerValues[] = {
        uint8_t(KCalendarCore::FreeBusyPeriod::FreeBusyType::Free),            //  0x00  0
        uint8_t(KCalendarCore::FreeBusyPeriod::FreeBusyType::Busy),            //  0x01  1
        uint8_t(KCalendarCore::FreeBusyPeriod::FreeBusyType::BusyUnavailable), //  0x02  2
        uint8_t(KCalendarCore::FreeBusyPeriod::FreeBusyType::BusyTentative),   //  0x03  3
        uint8_t(KCalendarCore::FreeBusyPeriod::FreeBusyType::Unknown)          //  0x04  4
        };
    EType = Shiboken::Enum::createPythonEnum(pyType,
        "1:KCalendarCore.KCalendarCore.FreeBusyPeriod.FreeBusyType",
        FreeBusyType_Initializer, FreeBusyType_InitializerValues);
    SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_FreeBusyPeriod_FreeBusyType_IDX].type = EType;
    // Register converter for enum 'KCalendarCore::FreeBusyPeriod::FreeBusyType'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(EType,
            KCalendarCore_FreeBusyPeriod_FreeBusyType_CppToPython_Enum);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            Enum_PythonToCpp_KCalendarCore_FreeBusyPeriod_FreeBusyType,
            is_Enum_PythonToCpp_KCalendarCore_FreeBusyPeriod_FreeBusyType_Convertible);
        Shiboken::Conversions::registerConverterName(converter, "KCalendarCore::FreeBusyPeriod::FreeBusyType");
        Shiboken::Conversions::registerConverterAlias(converter, "FreeBusyPeriod::FreeBusyType");
        Shiboken::Conversions::registerConverterAlias(converter, "FreeBusyType");
        Shiboken::Enum::setTypeConverter(EType, converter, nullptr);
    }
    // End of 'FreeBusyType' enum.

    qRegisterMetaType< ::KCalendarCore::FreeBusyPeriod *>();
    qRegisterMetaType< ::KCalendarCore::FreeBusyPeriod::FreeBusyType >("FreeBusyPeriod::FreeBusyType");
    qRegisterMetaType< ::KCalendarCore::FreeBusyPeriod::FreeBusyType >("KCalendarCore::FreeBusyPeriod::FreeBusyType");

    return pyType;
}
