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

// main header
#include "akonadi_agentmanager_wrapper.h"

// Wrappers providing overrides
#include "akonadi_trashfilterproxymodel_wrapper.h"

// Argument includes
#include <QList>
#include <QString>
#include <agentinstance.h>
#include <agentmanager.h>
#include <agenttype.h>
#include <collection.h>
#include <qmetaobject.h>
#include <qobject.h>
#include <qobjectdefs.h>

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

using namespace Akonadi;

extern "C" {
static PyTypeObject *Sbk_Akonadi_AgentManager_TypeF(void)
{
    return SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentManager_IDX].type;
}
} // extern "C"

// Native ---------------------------------------------------------

void AgentManagerWrapper::resetPyMethodCache()
{
    std::fill(m_PyMethodCache.begin(), m_PyMethodCache.end(), nullptr);
}

void AgentManagerWrapper::childEvent(::QChildEvent * event)
{
    static const char *funcName = "childEvent";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_AgentManager_TypeF(), gil, funcName, m_PyMethodCache[0], nameCache));
    if (pyOverride.isNull()) {
        return this->::QObject::childEvent(event);
    }
    TrashFilterProxyModelWrapper::sbk_o_childEvent("AgentManager", funcName, gil, pyOverride, event);
}

void AgentManagerWrapper::connectNotify(const ::QMetaMethod & signal)
{
    static const char *funcName = "connectNotify";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_AgentManager_TypeF(), gil, funcName, m_PyMethodCache[1], nameCache));
    if (pyOverride.isNull()) {
        return this->::QObject::connectNotify(signal);
    }
    TrashFilterProxyModelWrapper::sbk_o_connectNotify("AgentManager", funcName, gil, pyOverride, signal);
}

void AgentManagerWrapper::customEvent(::QEvent * event)
{
    static const char *funcName = "customEvent";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_AgentManager_TypeF(), gil, funcName, m_PyMethodCache[2], nameCache));
    if (pyOverride.isNull()) {
        return this->::QObject::customEvent(event);
    }
    TrashFilterProxyModelWrapper::sbk_o_customEvent("AgentManager", funcName, gil, pyOverride, event);
}

void AgentManagerWrapper::disconnectNotify(const ::QMetaMethod & signal)
{
    static const char *funcName = "disconnectNotify";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_AgentManager_TypeF(), gil, funcName, m_PyMethodCache[3], nameCache));
    if (pyOverride.isNull()) {
        return this->::QObject::disconnectNotify(signal);
    }
    TrashFilterProxyModelWrapper::sbk_o_connectNotify("AgentManager", funcName, gil, pyOverride, signal);
}

bool AgentManagerWrapper::event(::QEvent * event)
{
    static const char *funcName = "event";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_AgentManager_TypeF(), gil, funcName, m_PyMethodCache[4], nameCache));
    if (pyOverride.isNull()) {
        return this->::QObject::event(event);
    }
    return TrashFilterProxyModelWrapper::sbk_o_event("AgentManager", funcName, gil, pyOverride, event);
}

bool AgentManagerWrapper::eventFilter(::QObject * watched, ::QEvent * event)
{
    static const char *funcName = "eventFilter";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_AgentManager_TypeF(), gil, funcName, m_PyMethodCache[5], nameCache));
    if (pyOverride.isNull()) {
        return this->::QObject::eventFilter(watched, event);
    }
    return TrashFilterProxyModelWrapper::sbk_o_eventFilter("AgentManager", funcName, gil, pyOverride, watched, event);
}

void AgentManagerWrapper::timerEvent(::QTimerEvent * event)
{
    static const char *funcName = "timerEvent";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_AgentManager_TypeF(), gil, funcName, m_PyMethodCache[6], nameCache));
    if (pyOverride.isNull()) {
        return this->::QObject::timerEvent(event);
    }
    TrashFilterProxyModelWrapper::sbk_o_timerEvent("AgentManager", funcName, gil, pyOverride, event);
}

const QMetaObject *AgentManagerWrapper::metaObject() const
{
    if (QObject::d_ptr->metaObject != nullptr)
        return QObject::d_ptr->dynamicMetaObject();
    SbkObject *pySelf = Shiboken::BindingManager::instance().retrieveWrapper(this);
    if (pySelf == nullptr)
        return Akonadi::AgentManager::metaObject();
    return PySide::SignalManager::retrieveMetaObject(reinterpret_cast<PyObject *>(pySelf));
}

int AgentManagerWrapper::qt_metacall(QMetaObject::Call call, int id, void **args)
{
    int result = Akonadi::AgentManager::qt_metacall(call, id, args);
    return result < 0 ? result : PySide::SignalManager::qt_metacall(this, call, id, args);
}

void *AgentManagerWrapper::qt_metacast(const char *_clname)
{
    if (_clname == nullptr)
        return {};
    if (SbkObject *pySelf = Shiboken::BindingManager::instance().retrieveWrapper(this)) {
        auto *obSelf = reinterpret_cast<PyObject *>(pySelf);
        if (PySide::inherits(Py_TYPE(obSelf), _clname))
            return static_cast<void *>(const_cast< AgentManagerWrapper *>(this));
    }
    return Akonadi::AgentManager::qt_metacast(_clname);
}

AgentManagerWrapper::~AgentManagerWrapper()
{
    auto *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this, Sbk_Akonadi_AgentManager_TypeF());
    Shiboken::Object::destroy(wrapper, this);
}

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

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

static PyObject *Sbk_Akonadi_AgentManagerFunc_instance(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::Akonadi::AgentManager *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentManager_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: AgentManager::instance(const QString&)const->Akonadi::AgentInstance
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QString_IDX], (pyArg)))) {
        overloadId = 0; // AgentManager::instance(const QString&)const->Akonadi::AgentInstance
    }

    // Function signature not found.
    if (overloadId == -1)
        return Shiboken::returnWrongArguments(pyArg, "instance", SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentManager_IDX]);

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

        if (Shiboken::Errors::occurred() == nullptr) {
            // AgentManager::instance(const QString&)const->Akonadi::AgentInstance
            Akonadi::AgentInstance cppResult = const_cast<const ::Akonadi::AgentManager *>(cppSelf)->instance(cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentInstance_IDX]), &cppResult);
        }
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_Akonadi_AgentManagerFunc_instances(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::Akonadi::AgentManager *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentManager_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    Shiboken::PythonContextMarker pcm;

    // Call function/method
    {

        // AgentManager::instances()const->QList<Akonadi::AgentInstance>
        QList<Akonadi::AgentInstance> cppResult = const_cast<const ::Akonadi::AgentManager *>(cppSelf)->instances();
        pyResult = Shiboken::Conversions::copyToPython(SbkAkonadiCoreTypeConverters[SBK_AkonadiCore_QList_Akonadi_AgentInstance_IDX], &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

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

    // Overloaded function decisor
    // 0: AgentManager::removeInstance(const Akonadi::AgentInstance&)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentInstance_IDX]), (pyArg)))) {
        overloadId = 0; // AgentManager::removeInstance(const Akonadi::AgentInstance&)
    }

    // Function signature not found.
    if (overloadId == -1)
        return Shiboken::returnWrongArguments(pyArg, "removeInstance", SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentManager_IDX]);

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


        if (Shiboken::Errors::occurred() == nullptr) {
            // AgentManager::removeInstance(const Akonadi::AgentInstance&)
            cppSelf->removeInstance(*cppArg0);
        }
    }

     return Sbk_ReturnFromPython_None();
}

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

    // Call function/method
    {

        // static AgentManager::self()->Akonadi::AgentManager*
        Akonadi::AgentManager * cppResult = ::Akonadi::AgentManager::self();
        pyResult = Shiboken::Conversions::pointerToPython(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentManager_IDX]), cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_Akonadi_AgentManagerFunc_synchronizeCollection(PyObject *self, PyObject *args)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::Akonadi::AgentManager *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentManager_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

    if (PyArg_UnpackTuple(args, "synchronizeCollection", 1, 2, &(pyArgs[0]), &(pyArgs[1])) == 0)
        return {};


    // Overloaded function decisor
    // 0: AgentManager::synchronizeCollection(const Akonadi::Collection&)
    // 1: AgentManager::synchronizeCollection(const Akonadi::Collection&,bool)
    if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_Collection_IDX]), (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 0; // synchronizeCollection(Akonadi::Collection)
        } else if (numArgs == 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), (pyArgs[1])))) {
            overloadId = 1; // AgentManager::synchronizeCollection(const Akonadi::Collection&,bool)
        }
    }

    // Function signature not found.
    if (overloadId == -1)
        return Shiboken::returnWrongArguments(args, "synchronizeCollection", SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentManager_IDX]);

    // Call function/method
    switch (overloadId) {
        case 0: // synchronizeCollection(const Akonadi::Collection &collection)
        {
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return {};
            ::Akonadi::Collection cppArg0_local;
            ::Akonadi::Collection *cppArg0 = &cppArg0_local;
            if (pythonToCpp[0].isValue())
                pythonToCpp[0](pyArgs[0], &cppArg0_local);
            else
                pythonToCpp[0](pyArgs[0], &cppArg0);


            if (Shiboken::Errors::occurred() == nullptr) {
                // AgentManager::synchronizeCollection(const Akonadi::Collection&)
                cppSelf->synchronizeCollection(*cppArg0);
            }
            break;
        }
        case 1: // synchronizeCollection(const Akonadi::Collection &collection, bool recursive)
        {
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return {};
            ::Akonadi::Collection cppArg0_local;
            ::Akonadi::Collection *cppArg0 = &cppArg0_local;
            if (pythonToCpp[0].isValue())
                pythonToCpp[0](pyArgs[0], &cppArg0_local);
            else
                pythonToCpp[0](pyArgs[0], &cppArg0);

            bool cppArg1;
            pythonToCpp[1](pyArgs[1], &cppArg1);

            if (Shiboken::Errors::occurred() == nullptr) {
                // AgentManager::synchronizeCollection(const Akonadi::Collection&,bool)
                cppSelf->synchronizeCollection(*cppArg0, cppArg1);
            }
            break;
        }
    }

     return Sbk_ReturnFromPython_None();
}

static PyObject *Sbk_Akonadi_AgentManagerFunc_type(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::Akonadi::AgentManager *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentManager_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: AgentManager::type(const QString&)const->Akonadi::AgentType
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QString_IDX], (pyArg)))) {
        overloadId = 0; // AgentManager::type(const QString&)const->Akonadi::AgentType
    }

    // Function signature not found.
    if (overloadId == -1)
        return Shiboken::returnWrongArguments(pyArg, "type", SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentManager_IDX]);

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

        if (Shiboken::Errors::occurred() == nullptr) {
            // AgentManager::type(const QString&)const->Akonadi::AgentType
            Akonadi::AgentType cppResult = const_cast<const ::Akonadi::AgentManager *>(cppSelf)->type(cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentType_IDX]), &cppResult);
        }
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_Akonadi_AgentManagerFunc_types(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::Akonadi::AgentManager *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentManager_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    Shiboken::PythonContextMarker pcm;

    // Call function/method
    {

        // AgentManager::types()const->QList<Akonadi::AgentType>
        QList<Akonadi::AgentType> cppResult = const_cast<const ::Akonadi::AgentManager *>(cppSelf)->types();
        pyResult = Shiboken::Conversions::copyToPython(SbkAkonadiCoreTypeConverters[SBK_AkonadiCore_QList_Akonadi_AgentType_IDX], &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}


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

static PyMethodDef Sbk_Akonadi_AgentManager_methods[] = {
    {"instance", reinterpret_cast<PyCFunction>(Sbk_Akonadi_AgentManagerFunc_instance), METH_O, nullptr},
    {"instances", reinterpret_cast<PyCFunction>(Sbk_Akonadi_AgentManagerFunc_instances), METH_NOARGS, nullptr},
    {"removeInstance", reinterpret_cast<PyCFunction>(Sbk_Akonadi_AgentManagerFunc_removeInstance), METH_O, nullptr},
    {"self", reinterpret_cast<PyCFunction>(Sbk_Akonadi_AgentManagerFunc_self), METH_NOARGS|METH_STATIC, nullptr},
    {"synchronizeCollection", reinterpret_cast<PyCFunction>(Sbk_Akonadi_AgentManagerFunc_synchronizeCollection), METH_VARARGS, nullptr},
    {"type", reinterpret_cast<PyCFunction>(Sbk_Akonadi_AgentManagerFunc_type), METH_O, nullptr},
    {"types", reinterpret_cast<PyCFunction>(Sbk_Akonadi_AgentManagerFunc_types), METH_NOARGS, nullptr},
    {nullptr, nullptr, 0, nullptr} // Sentinel
};

static int Sbk_Akonadi_AgentManager_setattro(PyObject *self, PyObject *name, PyObject *value)
{
    PySide::Feature::Select(self);
    if (value != nullptr && PyCallable_Check(value) != 0) {
        auto plain_inst = reinterpret_cast< ::Akonadi::AgentManager *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentManager_IDX]), reinterpret_cast<SbkObject *>(self)));
        auto *inst = dynamic_cast<AgentManagerWrapper *>(plain_inst);
        if (inst != nullptr)
            inst->resetPyMethodCache();
    }
    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_AgentManager_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_AgentManager_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_Akonadi_AgentManager_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_setattro,    reinterpret_cast<void *>(Sbk_Akonadi_AgentManager_setattro)},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_Akonadi_AgentManager_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_Akonadi_AgentManager_clear)},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_Akonadi_AgentManager_methods)},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_Akonadi_AgentManager_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_AgentManager_spec = {
    "1:AkonadiCore.Akonadi.AgentManager",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_Akonadi_AgentManager_slots
};

} //extern "C"

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


// Type conversion functions.

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

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

}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
#if PYSIDE6_COMOPT_COMPRESS == 0
static const char *Akonadi_AgentManager_SignatureStrings[] = {
    "AkonadiCore.Akonadi.AgentManager.instance(self,identifier:QString)->AkonadiCore.Akonadi.AgentInstance",
    "AkonadiCore.Akonadi.AgentManager.instances(self)->QList[AkonadiCore.Akonadi.AgentInstance]",
    "AkonadiCore.Akonadi.AgentManager.removeInstance(self,instance:AkonadiCore.Akonadi.AgentInstance)",
    "AkonadiCore.Akonadi.AgentManager.self()->AkonadiCore.Akonadi.AgentManager",
    "1:AkonadiCore.Akonadi.AgentManager.synchronizeCollection(self,collection:AkonadiCore.Akonadi.Collection)",
    "0:AkonadiCore.Akonadi.AgentManager.synchronizeCollection(self,collection:AkonadiCore.Akonadi.Collection,recursive:bool)",
    "AkonadiCore.Akonadi.AgentManager.type(self,identifier:QString)->AkonadiCore.Akonadi.AgentType",
    "AkonadiCore.Akonadi.AgentManager.types(self)->QList[AkonadiCore.Akonadi.AgentType]",
    nullptr}; // Sentinel
#else
static constexpr size_t Akonadi_AgentManager_SignatureByteSize = 193;
static constexpr uint8_t Akonadi_AgentManager_SignatureBytes[193] = {
    0x78, 0xda, 0xbd, 0x92, 0xc1, 0x0a, 0xc2, 0x30, 0x0c, 0x40, 0xef, 0xfb, 0x92, 0x0d, 0xe6, 0xd0,
    0x6b, 0x0f, 0x42, 0xd9, 0x69, 0xa0, 0x87, 0xa1, 0x37, 0xd9, 0xa1, 0x76, 0xd9, 0x0c, 0xce, 0x54,
    0xda, 0x3a, 0x98, 0x5f, 0xef, 0xe6, 0x86, 0x22, 0xa8, 0x2d, 0x1e, 0xbc, 0x25, 0x24, 0x79, 0xaf,
    0x0d, 0xe1, 0x47, 0x45, 0xa2, 0xc4, 0x54, 0x69, 0x48, 0xf8, 0x18, 0x27, 0xbc, 0x06, 0xb2, 0x6b,
    0x41, 0xa2, 0x06, 0x9d, 0x20, 0x19, 0x2b, 0x48, 0x42, 0x68, 0xa0, 0xa9, 0x62, 0x2c, 0xfb, 0x12,
    0x56, 0x08, 0x9a, 0xe5, 0x1b, 0xab, 0x91, 0xea, 0x68, 0xb6, 0xe4, 0x9f, 0x18, 0xd9, 0x34, 0x1b,
    0x70, 0x5f, 0x8b, 0xb9, 0x6b, 0x7a, 0x66, 0xbe, 0x42, 0x63, 0x77, 0x4e, 0x72, 0xe1, 0x46, 0x6b,
    0x38, 0xa9, 0x16, 0xb2, 0xd7, 0x6f, 0x4c, 0x19, 0x73, 0x0a, 0x22, 0xb7, 0x60, 0x20, 0x86, 0xdf,
    0xd6, 0x30, 0x35, 0x06, 0x0b, 0xe6, 0x66, 0x75, 0x24, 0x0f, 0x5a, 0x11, 0x5e, 0x21, 0x55, 0x4d,
    0x03, 0xd2, 0xa2, 0xa2, 0xf1, 0xcd, 0xf2, 0x91, 0xbf, 0xc5, 0x3c, 0xdb, 0xa3, 0x60, 0xfe, 0x1f,
    0x51, 0xac, 0x41, 0x5e, 0xb4, 0xc1, 0x16, 0xd8, 0x5e, 0xa9, 0xc6, 0x63, 0x55, 0xb6, 0x3b, 0xff,
    0x74, 0x48, 0xdb, 0x7e, 0xce, 0x8f, 0xee, 0x7b, 0x40, 0x03, 0xb1, 0x08, 0x6e, 0xee, 0x96, 0x1b,
    0x80
};
#endif

PyTypeObject *init_Akonadi_AgentManager(PyObject *enclosingClass)
{
    auto &typeStruct = SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentManager_IDX];
    if (typeStruct.type != nullptr)
        return typeStruct.type;

    auto *base1 = reinterpret_cast<PyObject *>(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QObject_IDX]));
    Shiboken::AutoDecRef Sbk_Akonadi_AgentManager_Type_bases(PyTuple_Pack(1, base1));

    PyTypeObject *pyType = Shiboken::ObjectType::introduceWrapperType(
        enclosingClass,
        "AgentManager",
        "Akonadi::AgentManager*",
        &Sbk_Akonadi_AgentManager_spec,
        &Shiboken::callCppDestructor< Akonadi::AgentManager >,
        Sbk_Akonadi_AgentManager_Type_bases.object(),
        Shiboken::ObjectType::WrapperFlags::InnerClass);
#if PYSIDE6_COMOPT_COMPRESS == 0
    InitSignatureStrings(pyType, Akonadi_AgentManager_SignatureStrings);
#else
    InitSignatureBytes(pyType, Akonadi_AgentManager_SignatureBytes, Akonadi_AgentManager_SignatureByteSize);
#endif
    SbkObjectType_SetPropertyStrings(pyType, Sbk_Akonadi_AgentManager_PropertyStrings);
    typeStruct.type = pyType;

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(pyType,
        AgentManager_PythonToCpp_AgentManager_PTR,
        is_AgentManager_PythonToCpp_AgentManager_PTR_Convertible,
        AgentManager_PTR_CppToPython_AgentManager);

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

    Shiboken::ObjectType::setTypeDiscoveryFunctionV2(pyType, &Sbk_Akonadi_AgentManager_typeDiscovery);

    PySide::Signal::registerSignals(pyType, &::Akonadi::AgentManager::staticMetaObject);
    Shiboken::ObjectType::setSubTypeInitHook(pyType, &PySide::initQObjectSubType);
    PySide::initDynamicMetaObject(pyType, &::Akonadi::AgentManager::staticMetaObject, sizeof(AgentManagerWrapper));

    return pyType;
}
