
// 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 <pysideqobject.h>
#include <pysidesignal.h>
#include <pysideproperty.h>
#include <signalmanager.h>
#include <pysidemetafunction.h>
#include <pysideqenum.h>
#include <pysideutils.h>
#include <feature_select.h>
QT_WARNING_DISABLE_DEPRECATED


// module include
#include "akonadicalendar_python.h"

// main header
#include "akonadi_freebusymanager_wrapper.h"

// Argument includes
#include <QString>
#include <freebusymanager.h>
#include <qobject.h>
#include <qobjectdefs.h>
#include <qwidget.h>

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

using namespace Akonadi;

extern "C" {
static PyTypeObject *Sbk_Akonadi_FreeBusyManager_TypeF(void)
{
    return SbkAkonadiCalendarTypeStructs[SBK_Akonadi_FreeBusyManager_IDX].type;
}
} // extern "C"


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

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

static PyObject *Sbk_Akonadi_FreeBusyManagerFunc_cancelRetrieval(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::Akonadi::FreeBusyManager *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkAkonadiCalendarTypeStructs[SBK_Akonadi_FreeBusyManager_IDX]), reinterpret_cast<SbkObject *>(self)));
    Shiboken::PythonContextMarker pcm;

    // Call function/method
    {

        // FreeBusyManager::cancelRetrieval()
        cppSelf->cancelRetrieval();
    }

     return Sbk_ReturnFromPython_None();
}

static PyObject *Sbk_Akonadi_FreeBusyManagerFunc_mailFreeBusy(PyObject *self, PyObject *args, [[maybe_unused]] PyObject *kwds)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::Akonadi::FreeBusyManager *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkAkonadiCalendarTypeStructs[SBK_Akonadi_FreeBusyManager_IDX]), reinterpret_cast<SbkObject *>(self)));
    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
    errInfo.reset(Shiboken::checkInvalidArgumentCount(numArgs, 0, 2));
    if (!errInfo.isNull())
        return Shiboken::returnWrongArguments(args, "mailFreeBusy", errInfo, SbkAkonadiCalendarTypeStructs[SBK_Akonadi_FreeBusyManager_IDX]);

    if (PyArg_ParseTuple(args, "|OO:mailFreeBusy", &(pyArgs[0]), &(pyArgs[1])) == 0)
        return {};


    // Overloaded function decisor
    // 0: FreeBusyManager::mailFreeBusy(int=,QWidget*=)
    if (numArgs == 0) {
        overloadId = 0; // mailFreeBusy(int,QWidget*)
    } else if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 0; // mailFreeBusy(int,QWidget*)
        } else if (numArgs >= 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppPointerConversion(Shiboken::Module::get(SbkPySide6_QtWidgetsTypeStructs[SBK_QWidget_IDX]), (pyArgs[1])))) {
            overloadId = 0; // FreeBusyManager::mailFreeBusy(int=,QWidget*=)
        }
    }

    // Function signature not found.
    if (overloadId == -1)
        return Shiboken::returnWrongArguments(args, "mailFreeBusy", SbkAkonadiCalendarTypeStructs[SBK_Akonadi_FreeBusyManager_IDX]);

    // Call function/method
    {
        if (kwds != nullptr && PyDict_Size(kwds) > 0) {
            static const Shiboken::ArgumentNameIndexMapping mapping[2] = {{"daysToPublish", 0}, {"parentWidget", 1}};
            if (!Shiboken::parseKeywordArguments(kwds, mapping, 2, errInfo, pyArgs)
                || (pyArgs[0] != nullptr && !((pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[0])))))
                || (pyArgs[1] != nullptr && !((pythonToCpp[1] = Shiboken::Conversions::pythonToCppPointerConversion(Shiboken::Module::get(SbkPySide6_QtWidgetsTypeStructs[SBK_QWidget_IDX]), (pyArgs[1])))))) {
                Py_XINCREF(errInfo.object());
                return Shiboken::returnWrongArguments(args, "mailFreeBusy", errInfo, SbkAkonadiCalendarTypeStructs[SBK_Akonadi_FreeBusyManager_IDX]);
            }
        }
        int cppArg0 = 30;
        if (pythonToCpp[0])
            pythonToCpp[0](pyArgs[0], &cppArg0);
        if (!Shiboken::Object::isValid(pyArgs[1]))
            return {};
        ::QWidget *cppArg1 = nullptr;
        if (pythonToCpp[1])
            pythonToCpp[1](pyArgs[1], &cppArg1);

        if (Shiboken::Errors::occurred() == nullptr) {
            // FreeBusyManager::mailFreeBusy(int=,QWidget*=)
            cppSelf->mailFreeBusy(cppArg0, cppArg1);
        }
    }

     return Sbk_ReturnFromPython_None();
}

static PyObject *Sbk_Akonadi_FreeBusyManagerFunc_publishFreeBusy(PyObject *self, PyObject *args, [[maybe_unused]] PyObject *kwds)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::Akonadi::FreeBusyManager *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkAkonadiCalendarTypeStructs[SBK_Akonadi_FreeBusyManager_IDX]), reinterpret_cast<SbkObject *>(self)));
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp[1];
    const Py_ssize_t numArgs = PyTuple_Size(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {nullptr};

    // invalid argument lengths
    errInfo.reset(Shiboken::checkInvalidArgumentCount(numArgs, 0, 1));
    if (!errInfo.isNull())
        return Shiboken::returnWrongArguments(args, "publishFreeBusy", errInfo, SbkAkonadiCalendarTypeStructs[SBK_Akonadi_FreeBusyManager_IDX]);

    if (PyArg_ParseTuple(args, "|O:publishFreeBusy", &(pyArgs[0])) == 0)
        return {};


    // Overloaded function decisor
    // 0: FreeBusyManager::publishFreeBusy(QWidget*=)
    if (numArgs == 0) {
        overloadId = 0; // publishFreeBusy(QWidget*)
    } else if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppPointerConversion(Shiboken::Module::get(SbkPySide6_QtWidgetsTypeStructs[SBK_QWidget_IDX]), (pyArgs[0])))) {
        overloadId = 0; // FreeBusyManager::publishFreeBusy(QWidget*=)
    }

    // Function signature not found.
    if (overloadId == -1)
        return Shiboken::returnWrongArguments(args, "publishFreeBusy", SbkAkonadiCalendarTypeStructs[SBK_Akonadi_FreeBusyManager_IDX]);

    // Call function/method
    {
        if (kwds != nullptr && PyDict_Size(kwds) > 0) {
            static const Shiboken::ArgumentNameIndexMapping mapping[1] = {{"parentWidget", 0}};
            if (!Shiboken::parseKeywordArguments(kwds, mapping, 1, errInfo, pyArgs)
                || (pyArgs[0] != nullptr && !((pythonToCpp[0] = Shiboken::Conversions::pythonToCppPointerConversion(Shiboken::Module::get(SbkPySide6_QtWidgetsTypeStructs[SBK_QWidget_IDX]), (pyArgs[0])))))) {
                Py_XINCREF(errInfo.object());
                return Shiboken::returnWrongArguments(args, "publishFreeBusy", errInfo, SbkAkonadiCalendarTypeStructs[SBK_Akonadi_FreeBusyManager_IDX]);
            }
        }
        if (!Shiboken::Object::isValid(pyArgs[0]))
            return {};
        ::QWidget *cppArg0 = nullptr;
        if (pythonToCpp[0])
            pythonToCpp[0](pyArgs[0], &cppArg0);

        if (Shiboken::Errors::occurred() == nullptr) {
            // FreeBusyManager::publishFreeBusy(QWidget*=)
            cppSelf->publishFreeBusy(cppArg0);
        }
    }

     return Sbk_ReturnFromPython_None();
}

static PyObject *Sbk_Akonadi_FreeBusyManagerFunc_retrieveFreeBusy(PyObject *self, PyObject *args, [[maybe_unused]] PyObject *kwds)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::Akonadi::FreeBusyManager *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkAkonadiCalendarTypeStructs[SBK_Akonadi_FreeBusyManager_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    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, 2, 3));
    if (!errInfo.isNull())
        return Shiboken::returnWrongArguments(args, "retrieveFreeBusy", errInfo, SbkAkonadiCalendarTypeStructs[SBK_Akonadi_FreeBusyManager_IDX]);

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


    // Overloaded function decisor
    // 0: FreeBusyManager::retrieveFreeBusy(const QString&,bool,QWidget*=)->bool
    if (numArgs >= 2
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QString_IDX], (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), (pyArgs[1])))) {
        if (numArgs == 2) {
            overloadId = 0; // retrieveFreeBusy(QString,bool,QWidget*)
        } else if (numArgs >= 3
            && (pythonToCpp[2] = Shiboken::Conversions::pythonToCppPointerConversion(Shiboken::Module::get(SbkPySide6_QtWidgetsTypeStructs[SBK_QWidget_IDX]), (pyArgs[2])))) {
            overloadId = 0; // FreeBusyManager::retrieveFreeBusy(const QString&,bool,QWidget*=)->bool
        }
    }

    // Function signature not found.
    if (overloadId == -1)
        return Shiboken::returnWrongArguments(args, "retrieveFreeBusy", SbkAkonadiCalendarTypeStructs[SBK_Akonadi_FreeBusyManager_IDX]);

    // Call function/method
    {
        if (kwds != nullptr && PyDict_Size(kwds) > 0) {
            static const Shiboken::ArgumentNameIndexMapping mapping[1] = {{"parentWidget", 2}};
            if (!Shiboken::parseKeywordArguments(kwds, mapping, 1, errInfo, pyArgs)
                || (pyArgs[2] != nullptr && !((pythonToCpp[2] = Shiboken::Conversions::pythonToCppPointerConversion(Shiboken::Module::get(SbkPySide6_QtWidgetsTypeStructs[SBK_QWidget_IDX]), (pyArgs[2])))))) {
                Py_XINCREF(errInfo.object());
                return Shiboken::returnWrongArguments(args, "retrieveFreeBusy", errInfo, SbkAkonadiCalendarTypeStructs[SBK_Akonadi_FreeBusyManager_IDX]);
            }
        }
        ::QString cppArg0;
        pythonToCpp[0](pyArgs[0], &cppArg0);
        bool cppArg1;
        pythonToCpp[1](pyArgs[1], &cppArg1);
        if (!Shiboken::Object::isValid(pyArgs[2]))
            return {};
        ::QWidget *cppArg2 = nullptr;
        if (pythonToCpp[2])
            pythonToCpp[2](pyArgs[2], &cppArg2);

        if (Shiboken::Errors::occurred() == nullptr) {
            // FreeBusyManager::retrieveFreeBusy(const QString&,bool,QWidget*=)->bool
            bool cppResult = cppSelf->retrieveFreeBusy(cppArg0, cppArg1, cppArg2);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
        }
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_Akonadi_FreeBusyManagerFunc_self([[maybe_unused]] PyObject *self)
{
    PyObject *pyResult{};
    Shiboken::PythonContextMarker pcm;

    // Call function/method
    {

        // static FreeBusyManager::self()->Akonadi::FreeBusyManager*
        Akonadi::FreeBusyManager * cppResult = ::Akonadi::FreeBusyManager::self();
        pyResult = Shiboken::Conversions::pointerToPython(Shiboken::Module::get(SbkAkonadiCalendarTypeStructs[SBK_Akonadi_FreeBusyManager_IDX]), cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

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

    // Overloaded function decisor
    // 0: QObject::timerEvent(QTimerEvent*)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppPointerConversion(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QTimerEvent_IDX]), (pyArg)))) {
        overloadId = 0; // QObject::timerEvent(QTimerEvent*)
    }

    // Function signature not found.
    if (overloadId == -1)
        return Shiboken::returnWrongArguments(pyArg, "timerEvent", SbkAkonadiCalendarTypeStructs[SBK_Akonadi_FreeBusyManager_IDX]);

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

        if (Shiboken::Errors::occurred() == nullptr) {
            // QObject::timerEvent(QTimerEvent*)
            Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
                ? cppSelf->::Akonadi::FreeBusyManager::timerEvent(cppArg0)
                : cppSelf->timerEvent(cppArg0);
        }
    }

     return Sbk_ReturnFromPython_None();
}


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

static PyMethodDef Sbk_Akonadi_FreeBusyManager_methods[] = {
    {"cancelRetrieval", reinterpret_cast<PyCFunction>(Sbk_Akonadi_FreeBusyManagerFunc_cancelRetrieval), METH_NOARGS, nullptr},
    {"mailFreeBusy", reinterpret_cast<PyCFunction>(Sbk_Akonadi_FreeBusyManagerFunc_mailFreeBusy), METH_VARARGS|METH_KEYWORDS, nullptr},
    {"publishFreeBusy", reinterpret_cast<PyCFunction>(Sbk_Akonadi_FreeBusyManagerFunc_publishFreeBusy), METH_VARARGS|METH_KEYWORDS, nullptr},
    {"retrieveFreeBusy", reinterpret_cast<PyCFunction>(Sbk_Akonadi_FreeBusyManagerFunc_retrieveFreeBusy), METH_VARARGS|METH_KEYWORDS, nullptr},
    {"self", reinterpret_cast<PyCFunction>(Sbk_Akonadi_FreeBusyManagerFunc_self), METH_NOARGS|METH_STATIC, nullptr},
    {"timerEvent", reinterpret_cast<PyCFunction>(Sbk_Akonadi_FreeBusyManagerFunc_timerEvent), METH_O, nullptr},
    {nullptr, nullptr, 0, nullptr} // Sentinel
};

static int Sbk_Akonadi_FreeBusyManager_setattro(PyObject *self, PyObject *name, PyObject *value)
{
    PySide::Feature::Select(self);
    Shiboken::AutoDecRef pp(reinterpret_cast<PyObject *>(PySide::Property::getObject(self, name)));
    if (!pp.isNull())
        return PySide::Property::setValue(reinterpret_cast<PySideProperty *>(pp.object()), self, value);
    return PyObject_GenericSetAttr(self, name, value);
}

} // extern "C"

static int Sbk_Akonadi_FreeBusyManager_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_Akonadi_FreeBusyManager_clear(PyObject *self)
{
    auto clearProc = reinterpret_cast<inquiry>(PyType_GetSlot(SbkObject_TypeF(), Py_tp_clear));
    ;
    return clearProc(self);
}
int *
Sbk_Akonadi_FreeBusyManager_mi_init(const void *cptr)
{
    static int mi_offsets[] = {-2, 0, 0, 0, 0};
    if (mi_offsets[0] == -2) {
        const auto *class_ptr = reinterpret_cast<const Akonadi::FreeBusyManager *>(cptr);
        const auto base = reinterpret_cast<uintptr_t>(class_ptr);
        int *p = mi_offsets;
        *p++ = int(reinterpret_cast<uintptr_t>(static_cast<const QObject *>(class_ptr)) - base);
        *p++ = int(reinterpret_cast<uintptr_t>(static_cast<const QObject *>(static_cast<const Akonadi::FreeBusyManager *>(static_cast<const void *>(class_ptr)))) - base);
        *p++ = int(reinterpret_cast<uintptr_t>(static_cast<const KCalendarCore::FreeBusyCache *>(class_ptr)) - base);
        *p++ = int(reinterpret_cast<uintptr_t>(static_cast<const KCalendarCore::FreeBusyCache *>(static_cast<const Akonadi::FreeBusyManager *>(static_cast<const void *>(class_ptr)))) - base);
        std::sort(mi_offsets, p);
        auto *end = std::unique(mi_offsets, p);
        *end++ = -1;
        if (mi_offsets[0] == 0)
            std::memmove(&mi_offsets[0], &mi_offsets[1], (end - mi_offsets  - 1) * sizeof(int));
    }
    return mi_offsets;
}
static void * Sbk_Akonadi_FreeBusyManagerSpecialCastFunction(void *obj, PyTypeObject *desiredType)
{
    auto me = reinterpret_cast< ::Akonadi::FreeBusyManager *>(obj);
    if (desiredType == Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QObject_IDX]))
        return static_cast< ::QObject *>(me);
    else if (desiredType == Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_FreeBusyCache_IDX]))
        return static_cast< ::KCalendarCore::FreeBusyCache *>(me);
    return me;
}



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

static PyType_Slot Sbk_Akonadi_FreeBusyManager_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(SbkDeallocWrapperWithPrivateDtor)},
    {Py_tp_setattro,    reinterpret_cast<void *>(Sbk_Akonadi_FreeBusyManager_setattro)},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_Akonadi_FreeBusyManager_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_Akonadi_FreeBusyManager_clear)},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_Akonadi_FreeBusyManager_methods)},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_Akonadi_FreeBusyManager_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)},
    {0, nullptr}
};
static PyType_Spec Sbk_Akonadi_FreeBusyManager_spec = {
    "1:AkonadiCalendar.Akonadi.FreeBusyManager",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_Akonadi_FreeBusyManager_slots
};

} //extern "C"

static void *Sbk_Akonadi_FreeBusyManager_typeDiscovery([[maybe_unused]] void *cptr, [[maybe_unused]] PyTypeObject *instanceType)
{
    if (instanceType == Shiboken::SbkType< ::QObject >())
        return dynamic_cast< ::Akonadi::FreeBusyManager *>(reinterpret_cast< ::QObject *>(cptr));
    if (instanceType == Shiboken::SbkType< ::KCalendarCore::FreeBusyCache >())
        return dynamic_cast< ::Akonadi::FreeBusyManager *>(reinterpret_cast< ::KCalendarCore::FreeBusyCache *>(cptr));
    return {};
}


// Type conversion functions.

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

// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity).
static PyObject *FreeBusyManager_PTR_CppToPython_FreeBusyManager(const void *cppIn)
{
    return PySide::getWrapperForQObject(reinterpret_cast<::Akonadi::FreeBusyManager *>(const_cast<void *>(cppIn)), Sbk_Akonadi_FreeBusyManager_TypeF());

}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
#if PYSIDE6_COMOPT_COMPRESS == 0
static const char *Akonadi_FreeBusyManager_SignatureStrings[] = {
    "AkonadiCalendar.Akonadi.FreeBusyManager.cancelRetrieval(self)",
    "AkonadiCalendar.Akonadi.FreeBusyManager.mailFreeBusy(self,daysToPublish:int=30,parentWidget:PySide6.QtWidgets.QWidget=nullptr)",
    "AkonadiCalendar.Akonadi.FreeBusyManager.publishFreeBusy(self,parentWidget:PySide6.QtWidgets.QWidget=nullptr)",
    "AkonadiCalendar.Akonadi.FreeBusyManager.retrieveFreeBusy(self,email:QString,forceDownload:bool,parentWidget:PySide6.QtWidgets.QWidget=nullptr)->bool",
    "AkonadiCalendar.Akonadi.FreeBusyManager.self()->AkonadiCalendar.Akonadi.FreeBusyManager",
    "AkonadiCalendar.Akonadi.FreeBusyManager.timerEvent(self,event:PySide6.QtCore.QTimerEvent)",
    nullptr}; // Sentinel
#else
static constexpr size_t Akonadi_FreeBusyManager_SignatureByteSize = 209;
static constexpr uint8_t Akonadi_FreeBusyManager_SignatureBytes[209] = {
    0x78, 0xda, 0xb5, 0x90, 0xcb, 0x0a, 0xc2, 0x40, 0x0c, 0x45, 0xf7, 0x7e, 0x89, 0x42, 0x1d, 0x04,
    0xc1, 0x45, 0x41, 0xa1, 0xbe, 0x76, 0x82, 0x55, 0xc1, 0x75, 0xec, 0xc4, 0x3a, 0x18, 0x33, 0x25,
    0x33, 0x55, 0xfa, 0xf7, 0xb6, 0x56, 0x45, 0x77, 0xe3, 0xc2, 0x5d, 0x5e, 0x37, 0xf7, 0x24, 0xc9,
    0xd9, 0x32, 0x68, 0x33, 0x03, 0x42, 0xd6, 0x20, 0x2a, 0x69, 0x73, 0xb5, 0x14, 0xc4, 0x69, 0xe9,
    0xaa, 0x15, 0x30, 0xe4, 0x28, 0x2a, 0x03, 0xce, 0x90, 0x36, 0xe8, 0xc5, 0xe0, 0x15, 0xa8, 0xeb,
    0x90, 0x8e, 0xbd, 0x4e, 0x12, 0xa8, 0xbe, 0x80, 0xa1, 0x57, 0xed, 0x21, 0x8d, 0x34, 0x54, 0x6e,
    0x67, 0xd7, 0xe5, 0x81, 0x8c, 0x3b, 0xc5, 0x86, 0xfd, 0x78, 0x38, 0x88, 0x0a, 0x10, 0x64, 0xbf,
    0x37, 0x3a, 0x47, 0x1f, 0xaf, 0xab, 0xad, 0xd1, 0x38, 0x52, 0xe9, 0xb3, 0xe0, 0x54, 0xda, 0x06,
    0x63, 0x2e, 0x89, 0x0a, 0x2f, 0xe1, 0xf6, 0x45, 0x6b, 0xf3, 0x4d, 0xf0, 0x2f, 0x33, 0x69, 0x7f,
    0x84, 0xdf, 0x6e, 0xd8, 0xbc, 0x20, 0x4e, 0xb7, 0x75, 0x8f, 0xf3, 0xe8, 0x68, 0x25, 0xc3, 0xb9,
    0xbd, 0x31, 0x59, 0xd0, 0xf1, 0xc1, 0x5a, 0xfa, 0x15, 0xa7, 0x3f, 0x69, 0x54, 0xc1, 0x50, 0x0d,
    0x43, 0xb7, 0x16, 0x05, 0xce, 0x07, 0xef, 0xf5, 0xe6, 0x82, 0xb2, 0xb8, 0xd6, 0xe4, 0xcf, 0x33,
    0x9b, 0xf0, 0x03, 0x7f, 0x66, 0x05, 0x55, 0xba, 0x7b, 0x4f, 0xf5, 0x3a, 0x77, 0x5f, 0x61, 0xe8,
    0x65
};
#endif

PyTypeObject *init_Akonadi_FreeBusyManager(PyObject *enclosingClass)
{
    auto &typeStruct = SbkAkonadiCalendarTypeStructs[SBK_Akonadi_FreeBusyManager_IDX];
    if (typeStruct.type != nullptr)
        return typeStruct.type;

    auto *base1 = reinterpret_cast<PyObject *>(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QObject_IDX]));
    auto *base2 = reinterpret_cast<PyObject *>(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_FreeBusyCache_IDX]));
    Shiboken::AutoDecRef Sbk_Akonadi_FreeBusyManager_Type_bases(PyTuple_Pack(2, base1, base2));

    PyTypeObject *pyType = Shiboken::ObjectType::introduceWrapperType(
        enclosingClass,
        "FreeBusyManager",
        "Akonadi::FreeBusyManager*",
        &Sbk_Akonadi_FreeBusyManager_spec,
        nullptr,
        Sbk_Akonadi_FreeBusyManager_Type_bases.object(),
        Shiboken::ObjectType::WrapperFlags::InnerClass);
#if PYSIDE6_COMOPT_COMPRESS == 0
    InitSignatureStrings(pyType, Akonadi_FreeBusyManager_SignatureStrings);
#else
    InitSignatureBytes(pyType, Akonadi_FreeBusyManager_SignatureBytes, Akonadi_FreeBusyManager_SignatureByteSize);
#endif
    SbkObjectType_SetPropertyStrings(pyType, Sbk_Akonadi_FreeBusyManager_PropertyStrings);
    typeStruct.type = pyType;

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(pyType,
        FreeBusyManager_PythonToCpp_FreeBusyManager_PTR,
        is_FreeBusyManager_PythonToCpp_FreeBusyManager_PTR_Convertible,
        FreeBusyManager_PTR_CppToPython_FreeBusyManager);

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

    MultipleInheritanceInitFunction func = Sbk_Akonadi_FreeBusyManager_mi_init;
    Shiboken::ObjectType::setMultipleInheritanceFunction(Sbk_Akonadi_FreeBusyManager_TypeF(), func);
    Shiboken::ObjectType::setCastFunction(Sbk_Akonadi_FreeBusyManager_TypeF(), &Sbk_Akonadi_FreeBusyManagerSpecialCastFunction);
    Shiboken::ObjectType::setTypeDiscoveryFunctionV2(pyType, &Sbk_Akonadi_FreeBusyManager_typeDiscovery);

    Shiboken::ObjectType::setSubTypeInitHook(pyType, &PySide::initQObjectSubType);
    PySide::initDynamicMetaObject(pyType, &::Akonadi::FreeBusyManager::staticMetaObject, sizeof(::Akonadi::FreeBusyManager));

    return pyType;
}
