
// Workaround to access protected functions
#ifndef protected
#  define protected public
#endif

// default includes
#include <shiboken.h>
#include <sbkpep.h>
#include <sbkpepbuffer.h>

#define PYSIDE6_COMOPT_COMPRESS 1

#ifndef QT_NO_VERSION_TAGGING
#  define QT_NO_VERSION_TAGGING
#endif
#include <QtCore/QDebug>
#include <pysideqenum.h>
#include <pysideutils.h>
#include <feature_select.h>
QT_WARNING_DISABLE_DEPRECATED


// module include
#include "akonadicore_python.h"

// main header
#include "akonadi_searchquery_wrapper.h"

// Argument includes
#include <QString>
#include <qbytearray.h>
#include <qvariant.h>
#include <searchquery.h>

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

using namespace Akonadi;

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


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

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

    ::Akonadi::SearchQuery *cptr{};
    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_MinusOne(args, "__init__", errInfo, SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchQuery_IDX]);

    if (PyArg_ParseTuple(args, "|O:SearchQuery", &(pyArgs[0])) == 0)
        return -1;


    // Overloaded function decisor
    // 0: SearchQuery::SearchQuery(Akonadi::SearchTerm::Relation=)
    // 1: SearchQuery::SearchQuery(const Akonadi::SearchQuery&)
    if (numArgs == 0) {
        overloadId = 0; // SearchQuery(Akonadi::SearchTerm::Relation)
    } else if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Enum::getConverter(reinterpret_cast<SbkEnumType *>(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchTerm_Relation_IDX]))), (pyArgs[0])))) {
        overloadId = 0; // SearchQuery::SearchQuery(Akonadi::SearchTerm::Relation=)
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchQuery_IDX]), (pyArgs[0])))) {
        overloadId = 1; // SearchQuery::SearchQuery(const Akonadi::SearchQuery&)
    }

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

    // Resolve keyword arguments
    switch (overloadId) {
        case 0: // SearchQuery::SearchQuery(Akonadi::SearchTerm::Relation=)
        {
            if (kwds != nullptr && PyDict_Size(kwds) > 0) {
                static const Shiboken::ArgumentNameIndexMapping mapping[1] = {{"rel", 0}};
                if (!Shiboken::parseKeywordArguments(kwds, mapping, 1, errInfo, pyArgs)
                    || (pyArgs[0] != nullptr && !((pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Enum::getConverter(reinterpret_cast<SbkEnumType *>(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchTerm_Relation_IDX]))), (pyArgs[0])))))) {
                    Py_XINCREF(errInfo.object());
                    return Shiboken::returnWrongArguments_MinusOne(args, "__init__", errInfo, SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchQuery_IDX]);
                }
            }
            break;
        }
        case 1: // SearchQuery::SearchQuery(const Akonadi::SearchQuery&)
        {
            if (kwds != nullptr && PyDict_Size(kwds) > 0) {
                errInfo.reset(kwds);
                Py_INCREF(errInfo.object());
                return Shiboken::returnWrongArguments_MinusOne(args, "__init__", errInfo, SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchQuery_IDX]);
            }
            break;
        }
    }

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

    // Call function/method
    switch (overloadId) {
        case 0: // SearchQuery(Akonadi::SearchTerm::Relation rel)
        {
            ::Akonadi::SearchTerm::Relation cppArg0(Akonadi::SearchTerm::RelAnd);
            if (pythonToCpp[0])
                pythonToCpp[0](pyArgs[0], &cppArg0);

            if (Shiboken::Errors::occurred() == nullptr) {
                // SearchQuery::SearchQuery(Akonadi::SearchTerm::Relation=)
                cptr = new ::Akonadi::SearchQuery(cppArg0);
            }
            break;
        }
        case 1: // SearchQuery(const Akonadi::SearchQuery &other)
        {
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return -1;
            ::Akonadi::SearchQuery cppArg0_local;
            ::Akonadi::SearchQuery *cppArg0 = &cppArg0_local;
            if (pythonToCpp[0].isValue())
                pythonToCpp[0](pyArgs[0], &cppArg0_local);
            else
                pythonToCpp[0](pyArgs[0], &cppArg0);


            if (Shiboken::Errors::occurred() == nullptr) {
                // SearchQuery::SearchQuery(const Akonadi::SearchQuery&)
                cptr = new ::Akonadi::SearchQuery(*cppArg0);
            }
            break;
        }
    }

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

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


    return 1;
}

static PyObject *Sbk_Akonadi_SearchQueryFunc_addTerm(PyObject *self, PyObject *args, [[maybe_unused]] PyObject *kwds)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::Akonadi::SearchQuery *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchQuery_IDX]), reinterpret_cast<SbkObject *>(self)));
    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, 1, 3));
    if (!errInfo.isNull())
        return Shiboken::returnWrongArguments(args, "addTerm", errInfo, SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchQuery_IDX]);

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


    // Overloaded function decisor
    // 0: SearchQuery::addTerm(const Akonadi::SearchTerm&)
    // 1: SearchQuery::addTerm(const QString&,const QVariant&,Akonadi::SearchTerm::Condition=)
    if (numArgs >= 2
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QString_IDX], (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QVariant_IDX], (pyArgs[1])))) {
        if (numArgs == 2) {
            overloadId = 1; // addTerm(QString,QVariant,Akonadi::SearchTerm::Condition)
        } else if (numArgs >= 3
            && (pythonToCpp[2] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Enum::getConverter(reinterpret_cast<SbkEnumType *>(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchTerm_Condition_IDX]))), (pyArgs[2])))) {
            overloadId = 1; // SearchQuery::addTerm(const QString&,const QVariant&,Akonadi::SearchTerm::Condition=)
        }
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchTerm_IDX]), (pyArgs[0])))) {
        overloadId = 0; // SearchQuery::addTerm(const Akonadi::SearchTerm&)
    }

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

    // Call function/method
    switch (overloadId) {
        case 0: // addTerm(const Akonadi::SearchTerm &term)
        {
            if (kwds != nullptr && PyDict_Size(kwds) > 0) {
                errInfo.reset(kwds);
                Py_INCREF(errInfo.object());
                return Shiboken::returnWrongArguments(args, "addTerm", errInfo, SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchQuery_IDX]);
            }
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return {};
            ::Akonadi::SearchTerm cppArg0_local;
            ::Akonadi::SearchTerm *cppArg0 = &cppArg0_local;
            if (pythonToCpp[0].isValue())
                pythonToCpp[0](pyArgs[0], &cppArg0_local);
            else
                pythonToCpp[0](pyArgs[0], &cppArg0);


            if (Shiboken::Errors::occurred() == nullptr) {
                // SearchQuery::addTerm(const Akonadi::SearchTerm&)
                cppSelf->addTerm(*cppArg0);
            }
            break;
        }
        case 1: // addTerm(const QString &key, const QVariant &value, Akonadi::SearchTerm::Condition condition)
        {
            if (kwds != nullptr && PyDict_Size(kwds) > 0) {
                static const Shiboken::ArgumentNameIndexMapping mapping[1] = {{"condition", 2}};
                if (!Shiboken::parseKeywordArguments(kwds, mapping, 1, errInfo, pyArgs)
                    || (pyArgs[2] != nullptr && !((pythonToCpp[2] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Enum::getConverter(reinterpret_cast<SbkEnumType *>(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchTerm_Condition_IDX]))), (pyArgs[2])))))) {
                    Py_XINCREF(errInfo.object());
                    return Shiboken::returnWrongArguments(args, "addTerm", errInfo, SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchQuery_IDX]);
                }
            }
            ::QString cppArg0;
            pythonToCpp[0](pyArgs[0], &cppArg0);
            ::QVariant cppArg1;
            pythonToCpp[1](pyArgs[1], &cppArg1);
            ::Akonadi::SearchTerm::Condition cppArg2(Akonadi::SearchTerm::CondEqual);
            if (pythonToCpp[2])
                pythonToCpp[2](pyArgs[2], &cppArg2);

            if (Shiboken::Errors::occurred() == nullptr) {
                // SearchQuery::addTerm(const QString&,const QVariant&,Akonadi::SearchTerm::Condition=)
                cppSelf->addTerm(cppArg0, cppArg1, cppArg2);
            }
            break;
        }
    }

     return Sbk_ReturnFromPython_None();
}

static PyObject *Sbk_Akonadi_SearchQueryFunc_fromJSON([[maybe_unused]] PyObject *self, PyObject *pyArg)
{
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp;

    // Overloaded function decisor
    // 0: static SearchQuery::fromJSON(const QByteArray&)->Akonadi::SearchQuery
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QByteArray_IDX]), (pyArg)))) {
        overloadId = 0; // static SearchQuery::fromJSON(const QByteArray&)->Akonadi::SearchQuery
    }

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

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


        if (Shiboken::Errors::occurred() == nullptr) {
            // static SearchQuery::fromJSON(const QByteArray&)->Akonadi::SearchQuery
            Akonadi::SearchQuery cppResult = ::Akonadi::SearchQuery::fromJSON(*cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchQuery_IDX]), &cppResult);
        }
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

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

    // Call function/method
    {

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

    return Sbk_ReturnFromPython_Result(pyResult);
}

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

    // Call function/method
    {

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

    return Sbk_ReturnFromPython_Result(pyResult);
}

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

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

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

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

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

     return Sbk_ReturnFromPython_None();
}

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

    // Overloaded function decisor
    // 0: SearchQuery::setTerm(const Akonadi::SearchTerm&)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchTerm_IDX]), (pyArg)))) {
        overloadId = 0; // SearchQuery::setTerm(const Akonadi::SearchTerm&)
    }

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

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


        if (Shiboken::Errors::occurred() == nullptr) {
            // SearchQuery::setTerm(const Akonadi::SearchTerm&)
            cppSelf->setTerm(*cppArg0);
        }
    }

     return Sbk_ReturnFromPython_None();
}

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

    // Call function/method
    {

        // SearchQuery::term()const->Akonadi::SearchTerm
        Akonadi::SearchTerm cppResult = const_cast<const ::Akonadi::SearchQuery *>(cppSelf)->term();
        pyResult = Shiboken::Conversions::copyToPython(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchTerm_IDX]), &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

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

    // Call function/method
    {

        // SearchQuery::toJSON()const->QByteArray
        QByteArray cppResult = const_cast<const ::Akonadi::SearchQuery *>(cppSelf)->toJSON();
        pyResult = Shiboken::Conversions::copyToPython(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QByteArray_IDX]), &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_Akonadi_SearchQuery__copy__(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto &cppSelf = *reinterpret_cast< ::Akonadi::SearchQuery *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchQuery_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult = Shiboken::Conversions::copyToPython(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchQuery_IDX]), &cppSelf);
    if (Shiboken::Errors::occurred() != nullptr || pyResult == nullptr) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}


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

static PyMethodDef Sbk_Akonadi_SearchQuery_methods[] = {
    {"addTerm", reinterpret_cast<PyCFunction>(Sbk_Akonadi_SearchQueryFunc_addTerm), METH_VARARGS|METH_KEYWORDS, nullptr},
    {"fromJSON", reinterpret_cast<PyCFunction>(Sbk_Akonadi_SearchQueryFunc_fromJSON), METH_O|METH_STATIC, nullptr},
    {"isNull", reinterpret_cast<PyCFunction>(Sbk_Akonadi_SearchQueryFunc_isNull), METH_NOARGS, nullptr},
    {"limit", reinterpret_cast<PyCFunction>(Sbk_Akonadi_SearchQueryFunc_limit), METH_NOARGS, nullptr},
    {"setLimit", reinterpret_cast<PyCFunction>(Sbk_Akonadi_SearchQueryFunc_setLimit), METH_O, nullptr},
    {"setTerm", reinterpret_cast<PyCFunction>(Sbk_Akonadi_SearchQueryFunc_setTerm), METH_O, nullptr},
    {"term", reinterpret_cast<PyCFunction>(Sbk_Akonadi_SearchQueryFunc_term), METH_NOARGS, nullptr},
    {"toJSON", reinterpret_cast<PyCFunction>(Sbk_Akonadi_SearchQueryFunc_toJSON), METH_NOARGS, nullptr},
    {"__copy__", reinterpret_cast<PyCFunction>(Sbk_Akonadi_SearchQuery__copy__), METH_NOARGS, nullptr},
    {nullptr, nullptr, 0, nullptr} // Sentinel
};

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

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

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

    return Shiboken::returnFromRichCompare(pyResult);
}

} // extern "C"

static int Sbk_Akonadi_SearchQuery_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_SearchQuery_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_SearchQuery_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_Akonadi_SearchQuery_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_Akonadi_SearchQuery_clear)},
    {Py_tp_richcompare, reinterpret_cast<void *>(Sbk_Akonadi_SearchQuery_richcompare)},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_Akonadi_SearchQuery_methods)},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_Akonadi_SearchQuery_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObject_tp_new)},
    {0, nullptr}
};
static PyType_Spec Sbk_Akonadi_SearchQuery_spec = {
    "1:AkonadiCore.Akonadi.SearchQuery",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_Akonadi_SearchQuery_slots
};

} //extern "C"

// Type conversion functions.

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

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

}

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

// Python to C++ copy conversion.
static void SearchQuery_PythonToCpp_SearchQuery_COPY(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::Akonadi::SearchQuery *>(cppOut) = *reinterpret_cast< ::Akonadi::SearchQuery *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchQuery_IDX]), reinterpret_cast<SbkObject *>(pyIn)));
}
static PythonToCppFunc is_SearchQuery_PythonToCpp_SearchQuery_COPY_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, Sbk_Akonadi_SearchQuery_TypeF()))
        return SearchQuery_PythonToCpp_SearchQuery_COPY;
    return {};
}

// Implicit conversions.
static void Akonadi_SearchTerm_Relation_PythonToCpp_Akonadi_SearchQuery(PyObject *pyIn, void *cppOut)
{
    ::Akonadi::SearchTerm::Relation cppIn{Akonadi::SearchTerm::RelAnd};
    Shiboken::Conversions::pythonToCppCopy(Shiboken::Enum::getConverter(reinterpret_cast<SbkEnumType *>(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchTerm_Relation_IDX]))), pyIn, &cppIn);
    *reinterpret_cast<::Akonadi::SearchQuery *>(cppOut) = ::Akonadi::SearchQuery(cppIn);
}
static PythonToCppFunc is_Akonadi_SearchTerm_Relation_PythonToCpp_Akonadi_SearchQuery_Convertible(PyObject *pyIn)
{
    if (SbkObject_TypeCheck(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_SearchTerm_Relation_IDX]), pyIn))
        return Akonadi_SearchTerm_Relation_PythonToCpp_Akonadi_SearchQuery;
    return {};
}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
#if PYSIDE6_COMOPT_COMPRESS == 0
static const char *Akonadi_SearchQuery_SignatureStrings[] = {
    "1:AkonadiCore.Akonadi.SearchQuery(self,rel:AkonadiCore.Akonadi.SearchTerm.Relation=Akonadi.SearchTerm.RelAnd)",
    "0:AkonadiCore.Akonadi.SearchQuery(self,other:AkonadiCore.Akonadi.SearchQuery)",
    "1:AkonadiCore.Akonadi.SearchQuery.addTerm(self,term:typing.Union[AkonadiCore.Akonadi.SearchTerm, AkonadiCore.Akonadi.SearchTerm.Relation])",
    "0:AkonadiCore.Akonadi.SearchQuery.addTerm(self,key:QString,value:QVariant,condition:AkonadiCore.Akonadi.SearchTerm.Condition=Akonadi.SearchTerm.CondEqual)",
    "AkonadiCore.Akonadi.SearchQuery.fromJSON(json:typing.Union[PySide6.QtCore.QByteArray, char*])->AkonadiCore.Akonadi.SearchQuery",
    "AkonadiCore.Akonadi.SearchQuery.isNull(self)->bool",
    "AkonadiCore.Akonadi.SearchQuery.limit(self)->int",
    "AkonadiCore.Akonadi.SearchQuery.setLimit(self,limit:int)",
    "AkonadiCore.Akonadi.SearchQuery.setTerm(self,term:typing.Union[AkonadiCore.Akonadi.SearchTerm, AkonadiCore.Akonadi.SearchTerm.Relation])",
    "AkonadiCore.Akonadi.SearchQuery.term(self)->AkonadiCore.Akonadi.SearchTerm",
    "AkonadiCore.Akonadi.SearchQuery.toJSON(self)->PySide6.QtCore.QByteArray",
    "AkonadiCore.Akonadi.SearchQuery.__copy__(self)->typing._Self",
    "AkonadiCore.Akonadi.SearchQuery.__eq__(self,other:typing.Union[AkonadiCore.Akonadi.SearchQuery, AkonadiCore.Akonadi.SearchTerm.Relation])->bool",
    nullptr}; // Sentinel
#else
static constexpr size_t Akonadi_SearchQuery_SignatureByteSize = 308;
static constexpr uint8_t Akonadi_SearchQuery_SignatureBytes[308] = {
    0x78, 0xda, 0xbd, 0x93, 0x31, 0x4f, 0xc3, 0x30, 0x10, 0x85, 0xf7, 0xfc, 0x8a, 0x8e, 0x0d, 0x32,
    0x16, 0x5d, 0x18, 0x22, 0x15, 0x29, 0x54, 0x2c, 0x08, 0x15, 0x42, 0x80, 0x05, 0x55, 0x91, 0x49,
    0xae, 0xc4, 0xd4, 0xb1, 0x5b, 0xe7, 0x82, 0xe4, 0x7f, 0x8f, 0x13, 0x1c, 0xa4, 0x4a, 0x34, 0x36,
    0x0b, 0x9b, 0x2d, 0xdf, 0xf7, 0xee, 0xdd, 0xb3, 0xbd, 0x48, 0xd2, 0x9d, 0x92, 0xac, 0xe2, 0x2b,
    0xa5, 0x81, 0xba, 0x35, 0xcd, 0x81, 0xe9, 0xb2, 0xce, 0x3a, 0xd0, 0x66, 0xde, 0x82, 0xd8, 0x12,
    0x0d, 0x62, 0xa2, 0xf0, 0x09, 0x74, 0x43, 0x1f, 0x41, 0x30, 0xe4, 0x4a, 0x2e, 0x7f, 0x3f, 0x4b,
    0x65, 0x15, 0x47, 0x17, 0x61, 0xdd, 0x14, 0xd6, 0xa0, 0x7d, 0xa5, 0x71, 0xb4, 0xf0, 0x95, 0x50,
    0x56, 0x55, 0x7d, 0xff, 0x6f, 0x55, 0xb4, 0xab, 0x04, 0xcd, 0x9e, 0xcb, 0x77, 0xfa, 0x2c, 0xad,
    0xd3, 0xd7, 0xe9, 0x89, 0xc8, 0x2c, 0x70, 0xe2, 0x4d, 0xc0, 0x60, 0xc7, 0x56, 0x76, 0x60, 0x92,
    0x2c, 0x47, 0x6d, 0xad, 0x90, 0x4f, 0x26, 0x3a, 0x48, 0xb2, 0x17, 0xa6, 0x39, 0x93, 0x48, 0x4a,
    0x25, 0x2b, 0xde, 0xab, 0xfa, 0xf2, 0x5e, 0x8d, 0x85, 0xcb, 0x13, 0x87, 0x37, 0x87, 0x8e, 0x89,
    0x38, 0xf2, 0x19, 0xdb, 0x6a, 0xd5, 0xdc, 0xe6, 0xf7, 0xeb, 0xf9, 0x47, 0x6b, 0x9b, 0x1e, 0xe5,
    0xf3, 0x60, 0x72, 0x5e, 0xc1, 0x25, 0xcd, 0x70, 0xa0, 0xb3, 0x6b, 0x83, 0x90, 0x6a, 0xcd, 0x0c,
    0x99, 0x95, 0x35, 0xd3, 0x67, 0x9b, 0xf8, 0xfc, 0xca, 0x23, 0xef, 0x6d, 0xcf, 0xdb, 0x75, 0x27,
    0xc4, 0x10, 0x8b, 0x55, 0x7b, 0x53, 0x4a, 0x78, 0x11, 0xc1, 0x1b, 0x8e, 0x23, 0xc1, 0x25, 0x7a,
    0x81, 0x16, 0xf0, 0xee, 0x87, 0x21, 0x03, 0x9e, 0x58, 0x2e, 0x0e, 0x01, 0xff, 0xe7, 0xfd, 0xf8,
    0x8c, 0xe0, 0xe8, 0x62, 0x32, 0xf1, 0x5e, 0xd5, 0x2f, 0xa5, 0x86, 0xdb, 0x76, 0x62, 0x27, 0xaf,
    0xd8, 0xab, 0x53, 0x14, 0xa5, 0xda, 0x9b, 0xa2, 0x18, 0x95, 0x5c, 0x32, 0x45, 0x6e, 0xb7, 0x01,
    0x30, 0x1c, 0x1c, 0xea, 0x7e, 0x7b, 0x60, 0xb0, 0x03, 0xfe, 0x87, 0x64, 0xdd, 0x93, 0xfa, 0x02,
    0xe8, 0x4d, 0xcb, 0x15
};
#endif

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

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

    PyTypeObject *pyType = Shiboken::ObjectType::introduceWrapperType(
        enclosingClass,
        "SearchQuery",
        "Akonadi::SearchQuery",
        &Sbk_Akonadi_SearchQuery_spec,
        &Shiboken::callCppDestructor< ::Akonadi::SearchQuery >,
        Sbk_Akonadi_SearchQuery_Type_bases.object(),
        Shiboken::ObjectType::WrapperFlags::InnerClass | Shiboken::ObjectType::WrapperFlags::Value);
#if PYSIDE6_COMOPT_COMPRESS == 0
    InitSignatureStrings(pyType, Akonadi_SearchQuery_SignatureStrings);
#else
    InitSignatureBytes(pyType, Akonadi_SearchQuery_SignatureBytes, Akonadi_SearchQuery_SignatureByteSize);
#endif
    SbkObjectType_SetPropertyStrings(pyType, Sbk_Akonadi_SearchQuery_PropertyStrings);
    typeStruct.type = pyType;

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(pyType,
        SearchQuery_PythonToCpp_SearchQuery_PTR,
        is_SearchQuery_PythonToCpp_SearchQuery_PTR_Convertible,
        SearchQuery_PTR_CppToPython_SearchQuery,
        SearchQuery_COPY_CppToPython_SearchQuery);

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

    // Add Python to C++ copy (value, not pointer neither reference) conversion to type converter.
    Shiboken::Conversions::addPythonToCppValueConversion(converter,
        SearchQuery_PythonToCpp_SearchQuery_COPY,
        is_SearchQuery_PythonToCpp_SearchQuery_COPY_Convertible);
    // Add implicit conversions to type converter.
    Shiboken::Conversions::addPythonToCppValueConversion(converter,
        Akonadi_SearchTerm_Relation_PythonToCpp_Akonadi_SearchQuery,
        is_Akonadi_SearchTerm_Relation_PythonToCpp_Akonadi_SearchQuery_Convertible);

    qRegisterMetaType< ::Akonadi::SearchQuery >("SearchQuery");
    qRegisterMetaType< ::Akonadi::SearchQuery >("Akonadi::SearchQuery");

    return pyType;
}
