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

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

// Argument includes
#include <QList>
#include <QString>
#include <collection.h>
#include <item.h>
#include <itemsync.h>
#include <kjob.h>
#include <qdatetime.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_ItemSync_TypeF(void)
{
    return SbkAkonadiCoreTypeStructs[SBK_Akonadi_ItemSync_IDX].type;
}
} // extern "C"

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

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

ItemSyncWrapper::ItemSyncWrapper(const ::Akonadi::Collection & collection, const ::QDateTime & timestamp, ::QObject * parent) : Akonadi::ItemSync(collection, timestamp, parent)
{
}

bool ItemSyncWrapper::addSubjob(::KJob * job)
{
    static const char *funcName = "addSubjob";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_ItemSync_TypeF(), gil, funcName, m_PyMethodCache[0], nameCache));
    if (pyOverride.isNull()) {
        return this->::Akonadi::Job::addSubjob(job);
    }
    return SpecialCollectionsDiscoveryJobWrapper::sbk_o_addSubjob("ItemSync", funcName, gil, pyOverride, job);
}

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

void ItemSyncWrapper::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_ItemSync_TypeF(), gil, funcName, m_PyMethodCache[2], nameCache));
    if (pyOverride.isNull()) {
        return this->::QObject::connectNotify(signal);
    }
    TrashFilterProxyModelWrapper::sbk_o_connectNotify("ItemSync", funcName, gil, pyOverride, signal);
}

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

void ItemSyncWrapper::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_ItemSync_TypeF(), gil, funcName, m_PyMethodCache[4], nameCache));
    if (pyOverride.isNull()) {
        return this->::QObject::disconnectNotify(signal);
    }
    TrashFilterProxyModelWrapper::sbk_o_connectNotify("ItemSync", funcName, gil, pyOverride, signal);
}

bool ItemSyncWrapper::doKill()
{
    static const char *funcName = "doKill";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_ItemSync_TypeF(), gil, funcName, m_PyMethodCache[5], nameCache));
    if (pyOverride.isNull()) {
        return this->::Akonadi::Job::doKill();
    }
    return TrashFilterProxyModelWrapper::sbk_o_submit("ItemSync", funcName, gil, pyOverride);
}

bool ItemSyncWrapper::doResume()
{
    static const char *funcName = "doResume";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_ItemSync_TypeF(), gil, funcName, m_PyMethodCache[6], nameCache));
    if (pyOverride.isNull()) {
        return this->::KJob::doResume();
    }
    return TrashFilterProxyModelWrapper::sbk_o_submit("ItemSync", funcName, gil, pyOverride);
}

void ItemSyncWrapper::doStart()
{
    static const char *funcName = "doStart";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_ItemSync_TypeF(), gil, funcName, m_PyMethodCache[7], nameCache));
    if (pyOverride.isNull()) {
        return this->::Akonadi::ItemSync::doStart();
    }
    TrashFilterProxyModelWrapper::sbk_o_resetInternalData("ItemSync", funcName, gil, pyOverride);
}

bool ItemSyncWrapper::doSuspend()
{
    static const char *funcName = "doSuspend";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_ItemSync_TypeF(), gil, funcName, m_PyMethodCache[8], nameCache));
    if (pyOverride.isNull()) {
        return this->::KJob::doSuspend();
    }
    return TrashFilterProxyModelWrapper::sbk_o_submit("ItemSync", funcName, gil, pyOverride);
}

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

bool ItemSyncWrapper::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_ItemSync_TypeF(), gil, funcName, m_PyMethodCache[10], nameCache));
    if (pyOverride.isNull()) {
        return this->::QObject::eventFilter(watched, event);
    }
    return TrashFilterProxyModelWrapper::sbk_o_eventFilter("ItemSync", funcName, gil, pyOverride, watched, event);
}

bool ItemSyncWrapper::removeSubjob(::KJob * job)
{
    static const char *funcName = "removeSubjob";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_ItemSync_TypeF(), gil, funcName, m_PyMethodCache[11], nameCache));
    if (pyOverride.isNull()) {
        return this->::Akonadi::Job::removeSubjob(job);
    }
    return SpecialCollectionsDiscoveryJobWrapper::sbk_o_addSubjob("ItemSync", funcName, gil, pyOverride, job);
}

void ItemSyncWrapper::slotInfoMessage(::KJob * job, const ::QString & message)
{
    static const char *funcName = "slotInfoMessage";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_ItemSync_TypeF(), gil, funcName, m_PyMethodCache[12], nameCache));
    if (pyOverride.isNull()) {
        return this->::KCompositeJob::slotInfoMessage(job, message);
    }
    SpecialCollectionsDiscoveryJobWrapper::sbk_o_slotInfoMessage("ItemSync", funcName, gil, pyOverride, job, message);
}

void ItemSyncWrapper::slotResult(::KJob * job)
{
    static const char *funcName = "slotResult";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_ItemSync_TypeF(), gil, funcName, m_PyMethodCache[13], nameCache));
    if (pyOverride.isNull()) {
        return this->::Akonadi::ItemSync::slotResult(job);
    }
    SpecialCollectionsDiscoveryJobWrapper::sbk_o_slotResult("ItemSync", funcName, gil, pyOverride, job);
}

void ItemSyncWrapper::start()
{
    static const char *funcName = "start";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_ItemSync_TypeF(), gil, funcName, m_PyMethodCache[14], nameCache));
    if (pyOverride.isNull()) {
        return this->::Akonadi::Job::start();
    }
    TrashFilterProxyModelWrapper::sbk_o_resetInternalData("ItemSync", funcName, gil, pyOverride);
}

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

const QMetaObject *ItemSyncWrapper::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::ItemSync::metaObject();
    return PySide::SignalManager::retrieveMetaObject(reinterpret_cast<PyObject *>(pySelf));
}

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

void *ItemSyncWrapper::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< ItemSyncWrapper *>(this));
    }
    return Akonadi::ItemSync::qt_metacast(_clname);
}

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

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

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

    ItemSyncWrapper *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

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


    // Overloaded function decisor
    // 0: ItemSync::ItemSync(const Akonadi::Collection&,const QDateTime&=,QObject*=)
    if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_Collection_IDX]), (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 0; // ItemSync(Akonadi::Collection,QDateTime,QObject*)
        } else if (numArgs >= 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QDateTime_IDX]), (pyArgs[1])))) {
            if (numArgs == 2) {
                overloadId = 0; // ItemSync(Akonadi::Collection,QDateTime,QObject*)
            } else if (numArgs >= 3
                && (pythonToCpp[2] = Shiboken::Conversions::pythonToCppPointerConversion(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QObject_IDX]), (pyArgs[2])))) {
                overloadId = 0; // ItemSync::ItemSync(const Akonadi::Collection&,const QDateTime&=,QObject*=)
            }
        }
    }

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

    // Resolve keyword arguments
    {
        if (kwds != nullptr && PyDict_Size(kwds) > 0) {
            static const Shiboken::ArgumentNameIndexMapping mapping[2] = {{"timestamp", 1}, {"parent", 2}};
            if (!Shiboken::parseConstructorKeywordArguments(kwds, mapping, 2, errInfo, pyArgs)
                || (pyArgs[1] != nullptr && !((pythonToCpp[1] = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QDateTime_IDX]), (pyArgs[1])))))
                || (pyArgs[2] != nullptr && !((pythonToCpp[2] = Shiboken::Conversions::pythonToCppPointerConversion(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QObject_IDX]), (pyArgs[2])))))) {
                Py_XINCREF(errInfo.object());
                return Shiboken::returnWrongArguments_MinusOne(args, "__init__", errInfo, SbkAkonadiCoreTypeStructs[SBK_Akonadi_ItemSync_IDX]);
            }
        }
    }

    // PyMI support
    [[maybe_unused]] const bool usesPyMI = Shiboken::callInheritedInit(self, args, errInfo.isNull() ? kwds : errInfo.object(), SbkAkonadiCoreTypeStructs[SBK_Akonadi_ItemSync_IDX]);
    if (Shiboken::Errors::occurred() != nullptr)
        return -1;

    // Call function/method
    {
        if (!Shiboken::Object::isValid(pyArgs[0]))
            return -1;
        ::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::Object::isValid(pyArgs[1]))
            return -1;
        ::QDateTime cppArg1_local{};
        ::QDateTime *cppArg1 = &cppArg1_local;
        if (pythonToCpp[1]) {
            if (pythonToCpp[1].isValue())
                pythonToCpp[1](pyArgs[1], &cppArg1_local);
            else
                pythonToCpp[1](pyArgs[1], &cppArg1);
            }
        if (!Shiboken::Object::isValid(pyArgs[2]))
            return -1;
        ::QObject *cppArg2 = nullptr;
        if (pythonToCpp[2])
            pythonToCpp[2](pyArgs[2], &cppArg2);

        if (Shiboken::Errors::occurred() == nullptr) {
            // ItemSync::ItemSync(const Akonadi::Collection&,const QDateTime&=,QObject*=)
            void *addr = PySide::nextQObjectMemoryAddr();
            if (addr != nullptr) {
                cptr = new (addr) ItemSyncWrapper(*cppArg0, *cppArg1, cppArg2);
                PySide::setNextQObjectMemoryAddr(nullptr);
            } else {
                cptr = new ItemSyncWrapper(*cppArg0, *cppArg1, cppArg2);
            }

        }
    }

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

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

    // QObject setup
    PySide::Signal::updateSourceObject(self);
    const auto *metaObject = cptr->metaObject(); // <- init python qt properties
    if (!errInfo.isNull() && PyDict_Check(errInfo.object())) {
        if (!PySide::fillQtProperties(self, metaObject, errInfo, usesPyMI))
            return Shiboken::returnWrongArguments_MinusOne(args, "__init__", errInfo, SbkAkonadiCoreTypeStructs[SBK_Akonadi_ItemSync_IDX]);
    };


    return 1;
}

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

    // Call function/method
    {

        // ItemSync::batchSize()const->int
        int cppResult = const_cast<const ::Akonadi::ItemSync *>(cppSelf)->batchSize();
        pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

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

    // Call function/method
    {

        // ItemSync::deliveryDone()
        cppSelf->deliveryDone();
    }

     return Sbk_ReturnFromPython_None();
}

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

    // Call function/method
    {

        // Job::doStart()
        Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
            ? cppSelf->::Akonadi::ItemSync::doStart()
            : cppSelf->doStart();
    }

     return Sbk_ReturnFromPython_None();
}

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

    // Call function/method
    {

        // ItemSync::mergeMode()const->Akonadi::ItemSync::MergeMode
        Akonadi::ItemSync::MergeMode cppResult = const_cast<const ::Akonadi::ItemSync *>(cppSelf)->mergeMode();
        pyResult = Shiboken::Conversions::copyToPython(Shiboken::Enum::getConverter(reinterpret_cast<SbkEnumType *>(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_ItemSync_MergeMode_IDX]))), &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

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

    // Call function/method
    {

        // ItemSync::rollback()
        cppSelf->rollback();
    }

     return Sbk_ReturnFromPython_None();
}

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

    // Overloaded function decisor
    // 0: ItemSync::setBatchSize(int)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 0; // ItemSync::setBatchSize(int)
    }

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

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

        if (Shiboken::Errors::occurred() == nullptr) {
            // ItemSync::setBatchSize(int)
            cppSelf->setBatchSize(cppArg0);
        }
    }

     return Sbk_ReturnFromPython_None();
}

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

    // Overloaded function decisor
    // 0: ItemSync::setDisableAutomaticDeliveryDone(bool)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), (pyArg)))) {
        overloadId = 0; // ItemSync::setDisableAutomaticDeliveryDone(bool)
    }

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

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

        if (Shiboken::Errors::occurred() == nullptr) {
            // ItemSync::setDisableAutomaticDeliveryDone(bool)
            cppSelf->setDisableAutomaticDeliveryDone(cppArg0);
        }
    }

     return Sbk_ReturnFromPython_None();
}

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

    // Overloaded function decisor
    // 0: ItemSync::setFullSyncItems(const QList<Akonadi::Item>&)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(SbkAkonadiCoreTypeConverters[SBK_AkonadiCore_QList_Akonadi_Item_IDX], (pyArg)))) {
        overloadId = 0; // ItemSync::setFullSyncItems(const QList<Akonadi::Item>&)
    }

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

    // Call function/method
    {
        ::QList<Akonadi::Item> cppArg0;
        pythonToCpp(pyArg, &cppArg0);

        if (Shiboken::Errors::occurred() == nullptr) {
            // ItemSync::setFullSyncItems(const QList<Akonadi::Item>&)
            cppSelf->setFullSyncItems(cppArg0);
        }
    }

     return Sbk_ReturnFromPython_None();
}

static PyObject *Sbk_Akonadi_ItemSyncFunc_setIncrementalSyncItems(PyObject *self, PyObject *args)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::Akonadi::ItemSync *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_ItemSync_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, "setIncrementalSyncItems", 2, 2, &(pyArgs[0]), &(pyArgs[1])) == 0)
        return {};


    // Overloaded function decisor
    // 0: ItemSync::setIncrementalSyncItems(const QList<Akonadi::Item>&,const QList<Akonadi::Item>&)
    if (numArgs == 2
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(SbkAkonadiCoreTypeConverters[SBK_AkonadiCore_QList_Akonadi_Item_IDX], (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(SbkAkonadiCoreTypeConverters[SBK_AkonadiCore_QList_Akonadi_Item_IDX], (pyArgs[1])))) {
        overloadId = 0; // ItemSync::setIncrementalSyncItems(const QList<Akonadi::Item>&,const QList<Akonadi::Item>&)
    }

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

    // Call function/method
    {
        ::QList<Akonadi::Item> cppArg0;
        pythonToCpp[0](pyArgs[0], &cppArg0);
        ::QList<Akonadi::Item> cppArg1;
        pythonToCpp[1](pyArgs[1], &cppArg1);

        if (Shiboken::Errors::occurred() == nullptr) {
            // ItemSync::setIncrementalSyncItems(const QList<Akonadi::Item>&,const QList<Akonadi::Item>&)
            cppSelf->setIncrementalSyncItems(cppArg0, cppArg1);
        }
    }

     return Sbk_ReturnFromPython_None();
}

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

    // Overloaded function decisor
    // 0: ItemSync::setMergeMode(Akonadi::ItemSync::MergeMode)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Enum::getConverter(reinterpret_cast<SbkEnumType *>(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_ItemSync_MergeMode_IDX]))), (pyArg)))) {
        overloadId = 0; // ItemSync::setMergeMode(Akonadi::ItemSync::MergeMode)
    }

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

    // Call function/method
    {
        ::Akonadi::ItemSync::MergeMode cppArg0{Akonadi::ItemSync::RIDMerge};
        pythonToCpp(pyArg, &cppArg0);

        if (Shiboken::Errors::occurred() == nullptr) {
            // ItemSync::setMergeMode(Akonadi::ItemSync::MergeMode)
            cppSelf->setMergeMode(cppArg0);
        }
    }

     return Sbk_ReturnFromPython_None();
}

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

    // Overloaded function decisor
    // 0: ItemSync::setStreamingEnabled(bool)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), (pyArg)))) {
        overloadId = 0; // ItemSync::setStreamingEnabled(bool)
    }

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

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

        if (Shiboken::Errors::occurred() == nullptr) {
            // ItemSync::setStreamingEnabled(bool)
            cppSelf->setStreamingEnabled(cppArg0);
        }
    }

     return Sbk_ReturnFromPython_None();
}

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

    // Overloaded function decisor
    // 0: ItemSync::setTotalItems(int)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArg)))) {
        overloadId = 0; // ItemSync::setTotalItems(int)
    }

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

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

        if (Shiboken::Errors::occurred() == nullptr) {
            // ItemSync::setTotalItems(int)
            cppSelf->setTotalItems(cppArg0);
        }
    }

     return Sbk_ReturnFromPython_None();
}

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

    // Overloaded function decisor
    // 0: ItemSync::setTransactionMode(Akonadi::ItemSync::TransactionMode)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(Shiboken::Enum::getConverter(reinterpret_cast<SbkEnumType *>(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_ItemSync_TransactionMode_IDX]))), (pyArg)))) {
        overloadId = 0; // ItemSync::setTransactionMode(Akonadi::ItemSync::TransactionMode)
    }

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

    // Call function/method
    {
        ::Akonadi::ItemSync::TransactionMode cppArg0{Akonadi::ItemSync::SingleTransaction};
        pythonToCpp(pyArg, &cppArg0);

        if (Shiboken::Errors::occurred() == nullptr) {
            // ItemSync::setTransactionMode(Akonadi::ItemSync::TransactionMode)
            cppSelf->setTransactionMode(cppArg0);
        }
    }

     return Sbk_ReturnFromPython_None();
}

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

    // Overloaded function decisor
    // 0: KCompositeJob::slotResult(KJob*)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppPointerConversion(Shiboken::Module::get(SbkKCoreAddonsTypeStructs[SBK_KJob_IDX]), (pyArg)))) {
        overloadId = 0; // KCompositeJob::slotResult(KJob*)
    }

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

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

        if (Shiboken::Errors::occurred() == nullptr) {
            // KCompositeJob::slotResult(KJob*)
            Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
                ? cppSelf->::Akonadi::ItemSync::slotResult(cppArg0)
                : cppSelf->slotResult(cppArg0);
        }
    }

     return Sbk_ReturnFromPython_None();
}


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

static const char *Sbk_Akonadi_ItemSync_EnumFlagInfo[] = {
    "MergeMode:IntEnum",
    "TransactionMode:IntEnum",
    nullptr // Sentinel
};

static PyMethodDef Sbk_Akonadi_ItemSync_methods[] = {
    {"batchSize", reinterpret_cast<PyCFunction>(Sbk_Akonadi_ItemSyncFunc_batchSize), METH_NOARGS, nullptr},
    {"deliveryDone", reinterpret_cast<PyCFunction>(Sbk_Akonadi_ItemSyncFunc_deliveryDone), METH_NOARGS, nullptr},
    {"doStart", reinterpret_cast<PyCFunction>(Sbk_Akonadi_ItemSyncFunc_doStart), METH_NOARGS, nullptr},
    {"mergeMode", reinterpret_cast<PyCFunction>(Sbk_Akonadi_ItemSyncFunc_mergeMode), METH_NOARGS, nullptr},
    {"rollback", reinterpret_cast<PyCFunction>(Sbk_Akonadi_ItemSyncFunc_rollback), METH_NOARGS, nullptr},
    {"setBatchSize", reinterpret_cast<PyCFunction>(Sbk_Akonadi_ItemSyncFunc_setBatchSize), METH_O, nullptr},
    {"setDisableAutomaticDeliveryDone", reinterpret_cast<PyCFunction>(Sbk_Akonadi_ItemSyncFunc_setDisableAutomaticDeliveryDone), METH_O, nullptr},
    {"setFullSyncItems", reinterpret_cast<PyCFunction>(Sbk_Akonadi_ItemSyncFunc_setFullSyncItems), METH_O, nullptr},
    {"setIncrementalSyncItems", reinterpret_cast<PyCFunction>(Sbk_Akonadi_ItemSyncFunc_setIncrementalSyncItems), METH_VARARGS, nullptr},
    {"setMergeMode", reinterpret_cast<PyCFunction>(Sbk_Akonadi_ItemSyncFunc_setMergeMode), METH_O, nullptr},
    {"setStreamingEnabled", reinterpret_cast<PyCFunction>(Sbk_Akonadi_ItemSyncFunc_setStreamingEnabled), METH_O, nullptr},
    {"setTotalItems", reinterpret_cast<PyCFunction>(Sbk_Akonadi_ItemSyncFunc_setTotalItems), METH_O, nullptr},
    {"setTransactionMode", reinterpret_cast<PyCFunction>(Sbk_Akonadi_ItemSyncFunc_setTransactionMode), METH_O, nullptr},
    {"slotResult", reinterpret_cast<PyCFunction>(Sbk_Akonadi_ItemSyncFunc_slotResult), METH_O, nullptr},
    {nullptr, nullptr, 0, nullptr} // Sentinel
};

static int Sbk_Akonadi_ItemSync_setattro(PyObject *self, PyObject *name, PyObject *value)
{
    PySide::Feature::Select(self);
    if (value != nullptr && PyCallable_Check(value) != 0) {
        auto plain_inst = reinterpret_cast< ::Akonadi::ItemSync *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_ItemSync_IDX]), reinterpret_cast<SbkObject *>(self)));
        auto *inst = dynamic_cast<ItemSyncWrapper *>(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_ItemSync_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_ItemSync_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_ItemSync_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_setattro,    reinterpret_cast<void *>(Sbk_Akonadi_ItemSync_setattro)},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_Akonadi_ItemSync_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_Akonadi_ItemSync_clear)},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_Akonadi_ItemSync_methods)},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_Akonadi_ItemSync_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObject_tp_new)},
    {0, nullptr}
};
static PyType_Spec Sbk_Akonadi_ItemSync_spec = {
    "1:AkonadiCore.Akonadi.ItemSync",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_Akonadi_ItemSync_slots
};

} //extern "C"

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


// Type conversion functions.

// Python to C++ enum conversion.
static void Enum_PythonToCpp_Akonadi_ItemSync_MergeMode(PyObject *pyIn, void *cppOut)
{
    const auto value = static_cast<::Akonadi::ItemSync::MergeMode>(Shiboken::Enum::getValue(pyIn));
    *reinterpret_cast<::Akonadi::ItemSync::MergeMode *>(cppOut) = value;

}
static PythonToCppFunc is_Enum_PythonToCpp_Akonadi_ItemSync_MergeMode_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_ItemSync_MergeMode_IDX])))
        return Enum_PythonToCpp_Akonadi_ItemSync_MergeMode;
    return {};
}

static PyObject *Akonadi_ItemSync_MergeMode_CppToPython_Enum(PyTypeObject *pyType, const void *cppIn)
{
    using IntType = std::underlying_type_t<::Akonadi::ItemSync::MergeMode>;
    const auto castCppIn = IntType(*reinterpret_cast<const ::Akonadi::ItemSync::MergeMode *>(cppIn));
    return Shiboken::Enum::newItem(pyType, castCppIn);

}

static void Enum_PythonToCpp_Akonadi_ItemSync_TransactionMode(PyObject *pyIn, void *cppOut)
{
    const auto value = static_cast<::Akonadi::ItemSync::TransactionMode>(Shiboken::Enum::getValue(pyIn));
    *reinterpret_cast<::Akonadi::ItemSync::TransactionMode *>(cppOut) = value;

}
static PythonToCppFunc is_Enum_PythonToCpp_Akonadi_ItemSync_TransactionMode_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_ItemSync_TransactionMode_IDX])))
        return Enum_PythonToCpp_Akonadi_ItemSync_TransactionMode;
    return {};
}

static PyObject *Akonadi_ItemSync_TransactionMode_CppToPython_Enum(PyTypeObject *pyType, const void *cppIn)
{
    using IntType = std::underlying_type_t<::Akonadi::ItemSync::TransactionMode>;
    const auto castCppIn = IntType(*reinterpret_cast<const ::Akonadi::ItemSync::TransactionMode *>(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 ItemSync_PythonToCpp_ItemSync_PTR(PyObject *pyIn, void *cppOut)
{
    Shiboken::Conversions::pythonToCppPointer(Sbk_Akonadi_ItemSync_TypeF(), pyIn, cppOut);
}
static PythonToCppFunc is_ItemSync_PythonToCpp_ItemSync_PTR_Convertible(PyObject *pyIn)
{
    if (pyIn == Py_None)
        return Shiboken::Conversions::nonePythonToCppNullPtr;
    if (PyObject_TypeCheck(pyIn, Sbk_Akonadi_ItemSync_TypeF()))
        return ItemSync_PythonToCpp_ItemSync_PTR;
    return {};
}

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

}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
#if PYSIDE6_COMOPT_COMPRESS == 0
static const char *Akonadi_ItemSync_SignatureStrings[] = {
    "AkonadiCore.Akonadi.ItemSync(self,collection:AkonadiCore.Akonadi.Collection,timestamp:PySide6.QtCore.QDateTime={},parent:PySide6.QtCore.QObject=nullptr)",
    "AkonadiCore.Akonadi.ItemSync.batchSize(self)->int",
    "AkonadiCore.Akonadi.ItemSync.deliveryDone(self)",
    "AkonadiCore.Akonadi.ItemSync.doStart(self)",
    "AkonadiCore.Akonadi.ItemSync.mergeMode(self)->AkonadiCore.Akonadi.ItemSync.MergeMode",
    "AkonadiCore.Akonadi.ItemSync.rollback(self)",
    "AkonadiCore.Akonadi.ItemSync.setBatchSize(self,arg__1:int)",
    "AkonadiCore.Akonadi.ItemSync.setDisableAutomaticDeliveryDone(self,disable:bool)",
    "AkonadiCore.Akonadi.ItemSync.setFullSyncItems(self,items:QList[AkonadiCore.Akonadi.Item])",
    "AkonadiCore.Akonadi.ItemSync.setIncrementalSyncItems(self,changedItems:QList[AkonadiCore.Akonadi.Item],removedItems:QList[AkonadiCore.Akonadi.Item])",
    "AkonadiCore.Akonadi.ItemSync.setMergeMode(self,mergeMode:AkonadiCore.Akonadi.ItemSync.MergeMode)",
    "AkonadiCore.Akonadi.ItemSync.setStreamingEnabled(self,enable:bool)",
    "AkonadiCore.Akonadi.ItemSync.setTotalItems(self,amount:int)",
    "AkonadiCore.Akonadi.ItemSync.setTransactionMode(self,mode:AkonadiCore.Akonadi.ItemSync.TransactionMode)",
    "AkonadiCore.Akonadi.ItemSync.slotResult(self,job:KCoreAddons.KJob)",
    nullptr}; // Sentinel
#else
static constexpr size_t Akonadi_ItemSync_SignatureByteSize = 351;
static constexpr uint8_t Akonadi_ItemSync_SignatureBytes[351] = {
    0x78, 0xda, 0x95, 0x53, 0xc1, 0x4e, 0xc3, 0x30, 0x0c, 0xbd, 0xef, 0x4b, 0x98, 0x14, 0x2a, 0x71,
    0xe1, 0x50, 0x69, 0x48, 0x65, 0x05, 0x69, 0x8c, 0x09, 0x46, 0x77, 0x43, 0x68, 0x4a, 0x13, 0xd3,
    0x65, 0x4b, 0xe3, 0x29, 0x71, 0x27, 0x0d, 0xc4, 0xbf, 0x93, 0xae, 0x30, 0x6d, 0x03, 0x9a, 0x72,
    0xb3, 0x92, 0xe7, 0xe7, 0xe7, 0x67, 0x3b, 0x59, 0xa1, 0xe1, 0x52, 0x0d, 0xd1, 0x42, 0x94, 0x34,
    0x71, 0x34, 0x22, 0x28, 0xb3, 0xad, 0x11, 0x67, 0x0e, 0xf4, 0x2b, 0x13, 0xa8, 0x35, 0x08, 0x52,
    0x68, 0xe2, 0xe4, 0x17, 0xf0, 0x70, 0xff, 0xcd, 0x48, 0x95, 0xe0, 0x88, 0x97, 0xeb, 0xf8, 0x71,
    0x9b, 0x29, 0x09, 0x97, 0xd1, 0x94, 0x76, 0xd8, 0x69, 0xca, 0x09, 0x66, 0xfe, 0x77, 0xf0, 0xfe,
    0xc1, 0xd6, 0xdc, 0x82, 0xa1, 0x1f, 0x90, 0x87, 0x7c, 0xe9, 0x69, 0x06, 0xa6, 0xd2, 0x7a, 0x4d,
    0xb6, 0xdf, 0x4b, 0x5a, 0x84, 0x45, 0x39, 0x27, 0xb1, 0xc8, 0xd4, 0x1b, 0xec, 0x24, 0xf6, 0xcf,
    0xaf, 0x94, 0xa1, 0xf6, 0x0c, 0x09, 0x5a, 0x6d, 0xc0, 0x6e, 0x53, 0x34, 0x5f, 0x49, 0x01, 0x3c,
    0x66, 0xc4, 0x2d, 0x75, 0x81, 0x96, 0x60, 0x0b, 0x98, 0xa0, 0xdc, 0x8b, 0x69, 0x45, 0x4f, 0xbe,
    0xd1, 0xed, 0xa4, 0xd6, 0xdb, 0x9a, 0x73, 0xb1, 0xea, 0x22, 0xc0, 0x01, 0x5d, 0x1f, 0x19, 0xc2,
    0xb8, 0x2d, 0xe6, 0xf3, 0x8b, 0xd8, 0xbb, 0x12, 0x4e, 0x4d, 0x95, 0xe3, 0xb9, 0x86, 0xa4, 0x22,
    0x2c, 0x39, 0x29, 0x91, 0x9e, 0x3a, 0xc5, 0x64, 0x83, 0x88, 0x73, 0x44, 0x1d, 0xe6, 0xbb, 0xf5,
    0x13, 0xac, 0xe3, 0xfa, 0xcd, 0x35, 0x04, 0xaa, 0x0e, 0xe3, 0xe9, 0xbd, 0x72, 0xf4, 0xfc, 0x57,
    0xfa, 0x4b, 0x98, 0x79, 0x64, 0x84, 0x85, 0xd2, 0x2f, 0x0f, 0x3f, 0x2d, 0x20, 0x16, 0xdc, 0x14,
    0x20, 0x47, 0x5d, 0xea, 0x30, 0xcf, 0x81, 0x9b, 0x8e, 0xe0, 0xb0, 0xa8, 0xc9, 0xd1, 0xf4, 0xd9,
    0x7e, 0x19, 0xe2, 0x6e, 0x5b, 0x10, 0x2e, 0x90, 0x91, 0x05, 0x5e, 0x2a, 0x53, 0xdc, 0x98, 0x7a,
    0x0a, 0xb2, 0xa9, 0x03, 0xe6, 0x1f, 0x23, 0x99, 0xa1, 0xb7, 0xec, 0xc0, 0x2e, 0x5e, 0x62, 0xe5,
    0x4f, 0xb0, 0xd3, 0x7a, 0xcc, 0x2c, 0x37, 0x8e, 0xef, 0x0e, 0xfc, 0xa0, 0xcb, 0x60, 0x83, 0x27,
    0x69, 0xa1, 0x3a, 0x1a, 0xe9, 0x09, 0x5c, 0xa5, 0x9b, 0x83, 0x63, 0x4b, 0xcc, 0xe3, 0x71, 0x0d,
    0x4d, 0xa4, 0x44, 0xe3, 0xa2, 0xf1, 0x1d, 0xe6, 0xfd, 0xde, 0x27, 0x23, 0xfa, 0xb8, 0xa4
};
#endif

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

    auto *base1 = reinterpret_cast<PyObject *>(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_Job_IDX]));
    Shiboken::AutoDecRef Sbk_Akonadi_ItemSync_Type_bases(PyTuple_Pack(1, base1));

    PyTypeObject *pyType = Shiboken::ObjectType::introduceWrapperType(
        enclosingClass,
        "ItemSync",
        "Akonadi::ItemSync*",
        &Sbk_Akonadi_ItemSync_spec,
        &Shiboken::callCppDestructor< Akonadi::ItemSync >,
        Sbk_Akonadi_ItemSync_Type_bases.object(),
        Shiboken::ObjectType::WrapperFlags::InnerClass);
#if PYSIDE6_COMOPT_COMPRESS == 0
    InitSignatureStrings(pyType, Akonadi_ItemSync_SignatureStrings);
#else
    InitSignatureBytes(pyType, Akonadi_ItemSync_SignatureBytes, Akonadi_ItemSync_SignatureByteSize);
#endif
    SbkObjectType_SetPropertyStrings(pyType, Sbk_Akonadi_ItemSync_PropertyStrings);
    typeStruct.type = pyType;

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(pyType,
        ItemSync_PythonToCpp_ItemSync_PTR,
        is_ItemSync_PythonToCpp_ItemSync_PTR_Convertible,
        ItemSync_PTR_CppToPython_ItemSync);

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

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

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

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

    // Initialization of enum 'MergeMode'.
    const char *MergeMode_Initializer[] = {
        "RIDMerge",
        "GIDMerge",
        nullptr};
    // "uint8_t" used instead of "unsigned int"
    constexpr uint8_t MergeMode_InitializerValues[] = {
        uint8_t(Akonadi::ItemSync::MergeMode::RIDMerge), //  0x00  0
        uint8_t(Akonadi::ItemSync::MergeMode::GIDMerge)  //  0x01  1
        };
    EType = Shiboken::Enum::createPythonEnum(pyType,
        "1:AkonadiCore.Akonadi.ItemSync.MergeMode",
        MergeMode_Initializer, MergeMode_InitializerValues);
    SbkAkonadiCoreTypeStructs[SBK_Akonadi_ItemSync_MergeMode_IDX].type = EType;
    // Register converter for enum 'Akonadi::ItemSync::MergeMode'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(EType,
            Akonadi_ItemSync_MergeMode_CppToPython_Enum);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            Enum_PythonToCpp_Akonadi_ItemSync_MergeMode,
            is_Enum_PythonToCpp_Akonadi_ItemSync_MergeMode_Convertible);
        Shiboken::Conversions::registerConverterName(converter, "Akonadi::ItemSync::MergeMode");
        Shiboken::Conversions::registerConverterAlias(converter, "ItemSync::MergeMode");
        Shiboken::Conversions::registerConverterAlias(converter, "MergeMode");
        Shiboken::Enum::setTypeConverter(EType, converter, nullptr);
    }
    // End of 'MergeMode' enum.

    // Initialization of enum 'TransactionMode'.
    const char *TransactionMode_Initializer[] = {
        "SingleTransaction",
        "MultipleTransactions",
        "NoTransaction",
        nullptr};
    // "uint8_t" used instead of "unsigned int"
    constexpr uint8_t TransactionMode_InitializerValues[] = {
        uint8_t(Akonadi::ItemSync::TransactionMode::SingleTransaction),    //  0x00  0
        uint8_t(Akonadi::ItemSync::TransactionMode::MultipleTransactions), //  0x01  1
        uint8_t(Akonadi::ItemSync::TransactionMode::NoTransaction)         //  0x02  2
        };
    EType = Shiboken::Enum::createPythonEnum(pyType,
        "1:AkonadiCore.Akonadi.ItemSync.TransactionMode",
        TransactionMode_Initializer, TransactionMode_InitializerValues);
    SbkAkonadiCoreTypeStructs[SBK_Akonadi_ItemSync_TransactionMode_IDX].type = EType;
    // Register converter for enum 'Akonadi::ItemSync::TransactionMode'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(EType,
            Akonadi_ItemSync_TransactionMode_CppToPython_Enum);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            Enum_PythonToCpp_Akonadi_ItemSync_TransactionMode,
            is_Enum_PythonToCpp_Akonadi_ItemSync_TransactionMode_Convertible);
        Shiboken::Conversions::registerConverterName(converter, "Akonadi::ItemSync::TransactionMode");
        Shiboken::Conversions::registerConverterAlias(converter, "ItemSync::TransactionMode");
        Shiboken::Conversions::registerConverterAlias(converter, "TransactionMode");
        Shiboken::Enum::setTypeConverter(EType, converter, nullptr);
    }
    // End of 'TransactionMode' enum.

    PySide::Signal::registerSignals(pyType, &::Akonadi::ItemSync::staticMetaObject);
    qRegisterMetaType< ::Akonadi::ItemSync::MergeMode >("ItemSync::MergeMode");
    qRegisterMetaType< ::Akonadi::ItemSync::MergeMode >("Akonadi::ItemSync::MergeMode");
    qRegisterMetaType< ::Akonadi::ItemSync::TransactionMode >("ItemSync::TransactionMode");
    qRegisterMetaType< ::Akonadi::ItemSync::TransactionMode >("Akonadi::ItemSync::TransactionMode");
    Shiboken::ObjectType::setSubTypeInitHook(pyType, &PySide::initQObjectSubType);
    PySide::initDynamicMetaObject(pyType, &::Akonadi::ItemSync::staticMetaObject, sizeof(ItemSyncWrapper));

    return pyType;
}
