/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt for Python.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/

//workaround to access protected functions
#define protected public

// default includes
#include <shiboken.h>
#ifndef QT_NO_VERSION_TAGGING
#  define QT_NO_VERSION_TAGGING
#endif
#include <QDebug>
#include <pysidesignal.h>
#include <pysideproperty.h>
#include <pyside.h>
#include <pysideqenum.h>
#include <feature_select.h>
QT_WARNING_DISABLE_DEPRECATED

#include <typeinfo>
#include <iterator>

// module include
#include "pyside6_qtbluetooth_python.h"

// main header
#include "qlowenergyservicedata_wrapper.h"

// inner classes

// Extra includes
#include <QList>
#include <QtBluetooth/qbluetoothuuid.h>
#include <QtBluetooth/qlowenergycharacteristicdata.h>
#include <QtBluetooth/qlowenergyservice.h>
#include <QtBluetooth/qlowenergyservicedata.h>


#include <cctype>
#include <cstring>



template <class T>
static const char *typeNameOf(const T &t)
{
    const char *typeName =  typeid(t).name();
    auto size = std::strlen(typeName);
#if defined(Q_CC_MSVC) // MSVC: "class QPaintDevice * __ptr64"
    if (auto lastStar = strchr(typeName, '*')) {
        // MSVC: "class QPaintDevice * __ptr64"
        while (*--lastStar == ' ') {
        }
        size = lastStar - typeName + 1;
    }
#else // g++, Clang: "QPaintDevice *" -> "P12QPaintDevice"
    if (size > 2 && typeName[0] == 'P' && std::isdigit(typeName[1])) {
        ++typeName;
        --size;
    }
#endif
    char *result = new char[size + 1];
    result[size] = '\0';
    memcpy(result, typeName, size);
    return result;
}


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

extern "C" {
static int
Sbk_QLowEnergyServiceData_Init(PyObject *self, PyObject *args, PyObject *kwds)
{
    SbkObject *sbkSelf = reinterpret_cast<SbkObject *>(self);
    PySide::Feature::Select(self);
    if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::QLowEnergyServiceData >()))
        return -1;

    ::QLowEnergyServiceData *cptr{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtBluetooth.QLowEnergyServiceData.__init__";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp[1];
    SBK_UNUSED(pythonToCpp)
    const Py_ssize_t numArgs = PyTuple_GET_SIZE(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {0};

    // invalid argument lengths


    if (!PyArg_UnpackTuple(args, "QLowEnergyServiceData", 0, 1, &(pyArgs[0])))
        return -1;


    // Overloaded function decisor
    // 0: QLowEnergyServiceData::QLowEnergyServiceData()
    // 1: QLowEnergyServiceData::QLowEnergyServiceData(QLowEnergyServiceData)
    if (numArgs == 0) {
        overloadId = 0; // QLowEnergyServiceData()
    } else if (numArgs == 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], (pyArgs[0])))) {
        overloadId = 1; // QLowEnergyServiceData(QLowEnergyServiceData)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QLowEnergyServiceData_Init_TypeError;

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

            if (!PyErr_Occurred()) {
                // QLowEnergyServiceData()
                cptr = new ::QLowEnergyServiceData();
            }
            break;
        }
        case 1: // QLowEnergyServiceData(const QLowEnergyServiceData & other)
        {
            if (!Shiboken::Object::isValid(pyArgs[0]))
                return -1;
            ::QLowEnergyServiceData cppArg0_local;
            ::QLowEnergyServiceData *cppArg0 = &cppArg0_local;
            if (pythonToCpp[0].isValue())
                pythonToCpp[0](pyArgs[0], &cppArg0_local);
            else
                pythonToCpp[0](pyArgs[0], &cppArg0);


            if (!PyErr_Occurred()) {
                // QLowEnergyServiceData(QLowEnergyServiceData)
                cptr = new ::QLowEnergyServiceData(*cppArg0);
            }
            break;
        }
    }

    if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::QLowEnergyServiceData >(), cptr)) {
        delete cptr;
        return -1;
    }
    if (!cptr) goto Sbk_QLowEnergyServiceData_Init_TypeError;

    Shiboken::Object::setValidCpp(sbkSelf, true);
    if (Shiboken::BindingManager::instance().hasWrapper(cptr)) {
        Shiboken::BindingManager::instance().releaseWrapper(Shiboken::BindingManager::instance().retrieveWrapper(cptr));
    }
    Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr);


    return 1;

    Sbk_QLowEnergyServiceData_Init_TypeError:
        Shiboken::setErrorAboutWrongArguments(args, fullName, errInfo);
        return -1;
}

static PyObject *Sbk_QLowEnergyServiceDataFunc_addCharacteristic(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QLowEnergyServiceData *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtBluetooth.QLowEnergyServiceData.addCharacteristic";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QLowEnergyServiceData::addCharacteristic(QLowEnergyCharacteristicData)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYCHARACTERISTICDATA_IDX], (pyArg)))) {
        overloadId = 0; // addCharacteristic(QLowEnergyCharacteristicData)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QLowEnergyServiceDataFunc_addCharacteristic_TypeError;

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

        if (!PyErr_Occurred()) {
            // addCharacteristic(QLowEnergyCharacteristicData)
            cppSelf->addCharacteristic(*cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QLowEnergyServiceDataFunc_addCharacteristic_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QLowEnergyServiceDataFunc_addIncludedService(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QLowEnergyServiceData *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtBluetooth.QLowEnergyServiceData.addIncludedService";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QLowEnergyServiceData::addIncludedService(QLowEnergyService*)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppPointerConversion(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICE_IDX], (pyArg)))) {
        overloadId = 0; // addIncludedService(QLowEnergyService*)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QLowEnergyServiceDataFunc_addIncludedService_TypeError;

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

        if (!PyErr_Occurred()) {
            // addIncludedService(QLowEnergyService*)
            cppSelf->addIncludedService(cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QLowEnergyServiceDataFunc_addIncludedService_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QLowEnergyServiceDataFunc_characteristics(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QLowEnergyServiceData *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtBluetooth.QLowEnergyServiceData.characteristics";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // characteristics()const
            QList<QLowEnergyCharacteristicData > cppResult = const_cast<const ::QLowEnergyServiceData *>(cppSelf)->characteristics();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtBluetoothTypeConverters[SBK_QTBLUETOOTH_QLIST_QLOWENERGYCHARACTERISTICDATA_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QLowEnergyServiceDataFunc_includedServices(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QLowEnergyServiceData *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtBluetooth.QLowEnergyServiceData.includedServices";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // includedServices()const
            QList<QLowEnergyService* > cppResult = const_cast<const ::QLowEnergyServiceData *>(cppSelf)->includedServices();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtBluetoothTypeConverters[SBK_QTBLUETOOTH_QLIST_QLOWENERGYSERVICEPTR_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QLowEnergyServiceDataFunc_isValid(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QLowEnergyServiceData *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtBluetooth.QLowEnergyServiceData.isValid";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // isValid()const
            bool cppResult = const_cast<const ::QLowEnergyServiceData *>(cppSelf)->isValid();
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QLowEnergyServiceDataFunc_setCharacteristics(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QLowEnergyServiceData *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtBluetooth.QLowEnergyServiceData.setCharacteristics";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QLowEnergyServiceData::setCharacteristics(QList<QLowEnergyCharacteristicData>)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtBluetoothTypeConverters[SBK_QTBLUETOOTH_QLIST_QLOWENERGYCHARACTERISTICDATA_IDX], (pyArg)))) {
        overloadId = 0; // setCharacteristics(QList<QLowEnergyCharacteristicData>)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QLowEnergyServiceDataFunc_setCharacteristics_TypeError;

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

        if (!PyErr_Occurred()) {
            // setCharacteristics(QList<QLowEnergyCharacteristicData>)
            cppSelf->setCharacteristics(cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QLowEnergyServiceDataFunc_setCharacteristics_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QLowEnergyServiceDataFunc_setIncludedServices(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QLowEnergyServiceData *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtBluetooth.QLowEnergyServiceData.setIncludedServices";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QLowEnergyServiceData::setIncludedServices(QList<QLowEnergyService*>)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtBluetoothTypeConverters[SBK_QTBLUETOOTH_QLIST_QLOWENERGYSERVICEPTR_IDX], (pyArg)))) {
        overloadId = 0; // setIncludedServices(QList<QLowEnergyService*>)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QLowEnergyServiceDataFunc_setIncludedServices_TypeError;

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

        if (!PyErr_Occurred()) {
            // setIncludedServices(QList<QLowEnergyService*>)
            cppSelf->setIncludedServices(cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QLowEnergyServiceDataFunc_setIncludedServices_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QLowEnergyServiceDataFunc_setType(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QLowEnergyServiceData *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtBluetooth.QLowEnergyServiceData.setType";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QLowEnergyServiceData::setType(QLowEnergyServiceData::ServiceType)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_SERVICETYPE_IDX]))->converter, (pyArg)))) {
        overloadId = 0; // setType(QLowEnergyServiceData::ServiceType)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QLowEnergyServiceDataFunc_setType_TypeError;

    // Call function/method
    {
        ::QLowEnergyServiceData::ServiceType cppArg0 = static_cast< ::QLowEnergyServiceData::ServiceType>(0);
        pythonToCpp(pyArg, &cppArg0);

        if (!PyErr_Occurred()) {
            // setType(QLowEnergyServiceData::ServiceType)
            cppSelf->setType(cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QLowEnergyServiceDataFunc_setType_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QLowEnergyServiceDataFunc_setUuid(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QLowEnergyServiceData *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtBluetooth.QLowEnergyServiceData.setUuid";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QLowEnergyServiceData::setUuid(QBluetoothUuid)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtBluetoothTypes[SBK_QBLUETOOTHUUID_IDX], (pyArg)))) {
        overloadId = 0; // setUuid(QBluetoothUuid)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QLowEnergyServiceDataFunc_setUuid_TypeError;

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


        if (!PyErr_Occurred()) {
            // setUuid(QBluetoothUuid)
            cppSelf->setUuid(*cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QLowEnergyServiceDataFunc_setUuid_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QLowEnergyServiceDataFunc_swap(PyObject *self, PyObject *pyArg)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QLowEnergyServiceData *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtBluetooth.QLowEnergyServiceData.swap";
    SBK_UNUSED(fullName)
    int overloadId = -1;
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    // Overloaded function decisor
    // 0: QLowEnergyServiceData::swap(QLowEnergyServiceData&)
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], (pyArg)))) {
        overloadId = 0; // swap(QLowEnergyServiceData&)
    }

    // Function signature not found.
    if (overloadId == -1) goto Sbk_QLowEnergyServiceDataFunc_swap_TypeError;

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


        if (!PyErr_Occurred()) {
            // swap(QLowEnergyServiceData&)
            cppSelf->swap(*cppArg0);
        }
    }

    if (PyErr_Occurred()) {
        return {};
    }
    Py_RETURN_NONE;

    Sbk_QLowEnergyServiceDataFunc_swap_TypeError:
        Shiboken::setErrorAboutWrongArguments(pyArg, fullName, errInfo);
        return {};
}

static PyObject *Sbk_QLowEnergyServiceDataFunc_type(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QLowEnergyServiceData *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtBluetooth.QLowEnergyServiceData.type";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // type()const
            QLowEnergyServiceData::ServiceType cppResult = const_cast<const ::QLowEnergyServiceData *>(cppSelf)->type();
            pyResult = Shiboken::Conversions::copyToPython(PepType_SETP(reinterpret_cast<SbkEnumType *>(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_SERVICETYPE_IDX]))->converter, &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QLowEnergyServiceDataFunc_uuid(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto cppSelf = reinterpret_cast< ::QLowEnergyServiceData *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    static const char *fullName = "PySide6.QtBluetooth.QLowEnergyServiceData.uuid";
    SBK_UNUSED(fullName)

    // Call function/method
    {

        if (!PyErr_Occurred()) {
            // uuid()const
            QBluetoothUuid cppResult = const_cast<const ::QLowEnergyServiceData *>(cppSelf)->uuid();
            pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtBluetoothTypes[SBK_QBLUETOOTHUUID_IDX], &cppResult);
        }
    }

    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}

static PyObject *Sbk_QLowEnergyServiceData___copy__(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto &cppSelf = *reinterpret_cast< ::QLowEnergyServiceData *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], &cppSelf);
    if (PyErr_Occurred() || !pyResult) {
        Py_XDECREF(pyResult);
        return {};
    }
    return pyResult;
}


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

static PyMethodDef Sbk_QLowEnergyServiceData_methods[] = {
    {"addCharacteristic", reinterpret_cast<PyCFunction>(Sbk_QLowEnergyServiceDataFunc_addCharacteristic), METH_O},
    {"addIncludedService", reinterpret_cast<PyCFunction>(Sbk_QLowEnergyServiceDataFunc_addIncludedService), METH_O},
    {"characteristics", reinterpret_cast<PyCFunction>(Sbk_QLowEnergyServiceDataFunc_characteristics), METH_NOARGS},
    {"includedServices", reinterpret_cast<PyCFunction>(Sbk_QLowEnergyServiceDataFunc_includedServices), METH_NOARGS},
    {"isValid", reinterpret_cast<PyCFunction>(Sbk_QLowEnergyServiceDataFunc_isValid), METH_NOARGS},
    {"setCharacteristics", reinterpret_cast<PyCFunction>(Sbk_QLowEnergyServiceDataFunc_setCharacteristics), METH_O},
    {"setIncludedServices", reinterpret_cast<PyCFunction>(Sbk_QLowEnergyServiceDataFunc_setIncludedServices), METH_O},
    {"setType", reinterpret_cast<PyCFunction>(Sbk_QLowEnergyServiceDataFunc_setType), METH_O},
    {"setUuid", reinterpret_cast<PyCFunction>(Sbk_QLowEnergyServiceDataFunc_setUuid), METH_O},
    {"swap", reinterpret_cast<PyCFunction>(Sbk_QLowEnergyServiceDataFunc_swap), METH_O},
    {"type", reinterpret_cast<PyCFunction>(Sbk_QLowEnergyServiceDataFunc_type), METH_NOARGS},
    {"uuid", reinterpret_cast<PyCFunction>(Sbk_QLowEnergyServiceDataFunc_uuid), METH_NOARGS},

    {"__copy__", reinterpret_cast<PyCFunction>(Sbk_QLowEnergyServiceData___copy__), METH_NOARGS},
    {nullptr, nullptr} // Sentinel
};

// Rich comparison
static PyObject * Sbk_QLowEnergyServiceData_richcompare(PyObject *self, PyObject *pyArg, int op)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    auto &cppSelf = *reinterpret_cast< ::QLowEnergyServiceData *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], reinterpret_cast<SbkObject *>(self)));
    SBK_UNUSED(cppSelf)
    PyObject *pyResult{};
    Shiboken::Conversions::PythonToCppConversion pythonToCpp;
    SBK_UNUSED(pythonToCpp)

    switch (op) {
        case Py_NE:
            if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], (pyArg)))) {
                // operator!=(const QLowEnergyServiceData & b)
                if (!Shiboken::Object::isValid(pyArg))
                    return {};
                ::QLowEnergyServiceData cppArg0_local;
                ::QLowEnergyServiceData *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_True;
                Py_INCREF(pyResult);
            }

            break;
        case Py_EQ:
            if ((pythonToCpp = Shiboken::Conversions::pythonToCppReferenceConversion(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], (pyArg)))) {
                // operator==(const QLowEnergyServiceData & b)
                if (!Shiboken::Object::isValid(pyArg))
                    return {};
                ::QLowEnergyServiceData cppArg0_local;
                ::QLowEnergyServiceData *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);
            goto Sbk_QLowEnergyServiceData_RichComparison_TypeError;
    }

    if (pyResult && !PyErr_Occurred())
        return pyResult;
    Sbk_QLowEnergyServiceData_RichComparison_TypeError:
    PyErr_SetString(PyExc_NotImplementedError, "operator not implemented.");
    return {};

}

} // extern "C"

static int Sbk_QLowEnergyServiceData_traverse(PyObject *self, visitproc visit, void *arg)
{
    return SbkObject_TypeF()->tp_traverse(self, visit, arg);
}
static int Sbk_QLowEnergyServiceData_clear(PyObject *self)
{
    return reinterpret_cast<PyTypeObject *>(SbkObject_TypeF())->tp_clear(self);
}
// Class Definition -----------------------------------------------
extern "C" {
static PyTypeObject *_Sbk_QLowEnergyServiceData_Type = nullptr;
static PyTypeObject *Sbk_QLowEnergyServiceData_TypeF(void)
{
    return _Sbk_QLowEnergyServiceData_Type;
}

static PyType_Slot Sbk_QLowEnergyServiceData_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_repr,        nullptr},
    {Py_tp_hash,        nullptr},
    {Py_tp_call,        nullptr},
    {Py_tp_str,         nullptr},
    {Py_tp_getattro,    nullptr},
    {Py_tp_setattro,    nullptr},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_QLowEnergyServiceData_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_QLowEnergyServiceData_clear)},
    {Py_tp_richcompare, reinterpret_cast<void *>(Sbk_QLowEnergyServiceData_richcompare)},
    {Py_tp_iter,        nullptr},
    {Py_tp_iternext,    nullptr},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_QLowEnergyServiceData_methods)},
    {Py_tp_getset,      nullptr},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_QLowEnergyServiceData_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObjectTpNew)},
    {0, nullptr}
};
static PyType_Spec Sbk_QLowEnergyServiceData_spec = {
    "2:PySide6.QtBluetooth.QLowEnergyServiceData",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_QLowEnergyServiceData_slots
};

} //extern "C"


// Type conversion functions.

// Python to C++ enum conversion.
static void QLowEnergyServiceData_ServiceType_PythonToCpp_QLowEnergyServiceData_ServiceType(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QLowEnergyServiceData::ServiceType *>(cppOut) =
        static_cast<::QLowEnergyServiceData::ServiceType>(Shiboken::Enum::getValue(pyIn));

}
static PythonToCppFunc is_QLowEnergyServiceData_ServiceType_PythonToCpp_QLowEnergyServiceData_ServiceType_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_SERVICETYPE_IDX]))
        return QLowEnergyServiceData_ServiceType_PythonToCpp_QLowEnergyServiceData_ServiceType;
    return {};
}
static PyObject *QLowEnergyServiceData_ServiceType_CppToPython_QLowEnergyServiceData_ServiceType(const void *cppIn)
{
    const int castCppIn = int(*reinterpret_cast<const ::QLowEnergyServiceData::ServiceType *>(cppIn));
    return Shiboken::Enum::newItem(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_SERVICETYPE_IDX], castCppIn);

}

// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity).
static void QLowEnergyServiceData_PythonToCpp_QLowEnergyServiceData_PTR(PyObject *pyIn, void *cppOut)
{
    Shiboken::Conversions::pythonToCppPointer(Sbk_QLowEnergyServiceData_TypeF(), pyIn, cppOut);
}
static PythonToCppFunc is_QLowEnergyServiceData_PythonToCpp_QLowEnergyServiceData_PTR_Convertible(PyObject *pyIn)
{
    if (pyIn == Py_None)
        return Shiboken::Conversions::nonePythonToCppNullPtr;
    if (PyObject_TypeCheck(pyIn, reinterpret_cast<PyTypeObject *>(Sbk_QLowEnergyServiceData_TypeF())))
        return QLowEnergyServiceData_PythonToCpp_QLowEnergyServiceData_PTR;
    return {};
}

// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity).
static PyObject *QLowEnergyServiceData_PTR_CppToPython_QLowEnergyServiceData(const void *cppIn)
{
    auto pyOut = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(cppIn));
    if (pyOut) {
        Py_INCREF(pyOut);
        return pyOut;
    }
    bool changedTypeName = false;
    auto tCppIn = reinterpret_cast<const ::QLowEnergyServiceData *>(cppIn);
    const char *typeName = typeid(*tCppIn).name();
    auto sbkType = Shiboken::ObjectType::typeForTypeName(typeName);
    if (sbkType && Shiboken::ObjectType::hasSpecialCastFunction(sbkType)) {
        typeName = typeNameOf(tCppIn);
        changedTypeName = true;
    }
    PyObject *result = Shiboken::Object::newObject(Sbk_QLowEnergyServiceData_TypeF(), const_cast<void *>(cppIn), false, /* exactType */ changedTypeName, typeName);
    if (changedTypeName)
        delete [] typeName;
    return result;
}

// C++ to Python copy conversion.
static PyObject *QLowEnergyServiceData_COPY_CppToPython_QLowEnergyServiceData(const void *cppIn)
{
    return Shiboken::Object::newObject(Sbk_QLowEnergyServiceData_TypeF(), new ::QLowEnergyServiceData(*reinterpret_cast<const ::QLowEnergyServiceData *>(cppIn)), true, true);
}

// Python to C++ copy conversion.
static void QLowEnergyServiceData_PythonToCpp_QLowEnergyServiceData_COPY(PyObject *pyIn, void *cppOut)
{
    *reinterpret_cast<::QLowEnergyServiceData *>(cppOut) = *reinterpret_cast< ::QLowEnergyServiceData *>(Shiboken::Conversions::cppPointer(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX], reinterpret_cast<SbkObject *>(pyIn)));
}
static PythonToCppFunc is_QLowEnergyServiceData_PythonToCpp_QLowEnergyServiceData_COPY_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, reinterpret_cast<PyTypeObject *>(Sbk_QLowEnergyServiceData_TypeF())))
        return QLowEnergyServiceData_PythonToCpp_QLowEnergyServiceData_COPY;
    return {};
}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
static const char *QLowEnergyServiceData_SignatureStrings[] = {
    "1:PySide6.QtBluetooth.QLowEnergyServiceData(self)",
    "0:PySide6.QtBluetooth.QLowEnergyServiceData(self,other:PySide6.QtBluetooth.QLowEnergyServiceData)",
    "PySide6.QtBluetooth.QLowEnergyServiceData.addCharacteristic(self,characteristic:PySide6.QtBluetooth.QLowEnergyCharacteristicData)",
    "PySide6.QtBluetooth.QLowEnergyServiceData.addIncludedService(self,service:PySide6.QtBluetooth.QLowEnergyService)",
    "PySide6.QtBluetooth.QLowEnergyServiceData.characteristics(self)->QList[PySide6.QtBluetooth.QLowEnergyCharacteristicData]",
    "PySide6.QtBluetooth.QLowEnergyServiceData.includedServices(self)->QList[PySide6.QtBluetooth.QLowEnergyService]",
    "PySide6.QtBluetooth.QLowEnergyServiceData.isValid(self)->bool",
    "PySide6.QtBluetooth.QLowEnergyServiceData.setCharacteristics(self,characteristics:QList[PySide6.QtBluetooth.QLowEnergyCharacteristicData])",
    "PySide6.QtBluetooth.QLowEnergyServiceData.setIncludedServices(self,services:QList[PySide6.QtBluetooth.QLowEnergyService])",
    "PySide6.QtBluetooth.QLowEnergyServiceData.setType(self,type:PySide6.QtBluetooth.QLowEnergyServiceData.ServiceType)",
    "PySide6.QtBluetooth.QLowEnergyServiceData.setUuid(self,uuid:typing.Union[PySide6.QtBluetooth.QBluetoothUuid, PySide6.QtBluetooth.QBluetoothUuid.CharacteristicType, PySide6.QtBluetooth.QBluetoothUuid.DescriptorType, PySide6.QtBluetooth.QBluetoothUuid.ProtocolUuid, PySide6.QtBluetooth.QBluetoothUuid.ServiceClassUuid, PySide6.QtCore.QUuid])",
    "PySide6.QtBluetooth.QLowEnergyServiceData.swap(self,other:PySide6.QtBluetooth.QLowEnergyServiceData)",
    "PySide6.QtBluetooth.QLowEnergyServiceData.type(self)->PySide6.QtBluetooth.QLowEnergyServiceData.ServiceType",
    "PySide6.QtBluetooth.QLowEnergyServiceData.uuid(self)->PySide6.QtBluetooth.QBluetoothUuid",
    "PySide6.QtBluetooth.QLowEnergyServiceData.__copy__()",
    nullptr}; // Sentinel

void init_QLowEnergyServiceData(PyObject *module)
{
    _Sbk_QLowEnergyServiceData_Type = Shiboken::ObjectType::introduceWrapperType(
        module,
        "QLowEnergyServiceData",
        "QLowEnergyServiceData",
        &Sbk_QLowEnergyServiceData_spec,
        &Shiboken::callCppDestructor< ::QLowEnergyServiceData >,
        0,
        0,
        0);
    auto *pyType = Sbk_QLowEnergyServiceData_TypeF(); // references _Sbk_QLowEnergyServiceData_Type
    InitSignatureStrings(pyType, QLowEnergyServiceData_SignatureStrings);
    SbkObjectType_SetPropertyStrings(reinterpret_cast<PyTypeObject *>(_Sbk_QLowEnergyServiceData_Type), Sbk_QLowEnergyServiceData_PropertyStrings);
    SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_IDX]
        = Sbk_QLowEnergyServiceData_TypeF();

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(Sbk_QLowEnergyServiceData_TypeF(),
        QLowEnergyServiceData_PythonToCpp_QLowEnergyServiceData_PTR,
        is_QLowEnergyServiceData_PythonToCpp_QLowEnergyServiceData_PTR_Convertible,
        QLowEnergyServiceData_PTR_CppToPython_QLowEnergyServiceData,
        QLowEnergyServiceData_COPY_CppToPython_QLowEnergyServiceData);

    Shiboken::Conversions::registerConverterName(converter, "QLowEnergyServiceData");
    Shiboken::Conversions::registerConverterName(converter, "QLowEnergyServiceData*");
    Shiboken::Conversions::registerConverterName(converter, "QLowEnergyServiceData&");
    Shiboken::Conversions::registerConverterName(converter, typeid(::QLowEnergyServiceData).name());

    // Add Python to C++ copy (value, not pointer neither reference) conversion to type converter.
    Shiboken::Conversions::addPythonToCppValueConversion(converter,
        QLowEnergyServiceData_PythonToCpp_QLowEnergyServiceData_COPY,
        is_QLowEnergyServiceData_PythonToCpp_QLowEnergyServiceData_COPY_Convertible);

    // Initialization of enums.

    // Initialization of enum 'ServiceType'.
    SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_SERVICETYPE_IDX] = Shiboken::Enum::createScopedEnum(Sbk_QLowEnergyServiceData_TypeF(),
        "ServiceType",
        "2:PySide6.QtBluetooth.QLowEnergyServiceData.ServiceType",
        "QLowEnergyServiceData::ServiceType");
    if (!SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_SERVICETYPE_IDX])
        return;

    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_SERVICETYPE_IDX],
        Sbk_QLowEnergyServiceData_TypeF(), "ServiceTypePrimary", (long) QLowEnergyServiceData::ServiceType::ServiceTypePrimary))
        return;
    if (!Shiboken::Enum::createScopedEnumItem(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_SERVICETYPE_IDX],
        Sbk_QLowEnergyServiceData_TypeF(), "ServiceTypeSecondary", (long) QLowEnergyServiceData::ServiceType::ServiceTypeSecondary))
        return;
    // Register converter for enum 'QLowEnergyServiceData::ServiceType'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_SERVICETYPE_IDX],
            QLowEnergyServiceData_ServiceType_CppToPython_QLowEnergyServiceData_ServiceType);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            QLowEnergyServiceData_ServiceType_PythonToCpp_QLowEnergyServiceData_ServiceType,
            is_QLowEnergyServiceData_ServiceType_PythonToCpp_QLowEnergyServiceData_ServiceType_Convertible);
        Shiboken::Enum::setTypeConverter(SbkPySide6_QtBluetoothTypes[SBK_QLOWENERGYSERVICEDATA_SERVICETYPE_IDX], converter, false);
        Shiboken::Conversions::registerConverterName(converter, "QLowEnergyServiceData::ServiceType");
        Shiboken::Conversions::registerConverterName(converter, "ServiceType");
    }
    // End of 'ServiceType' enum.

    qRegisterMetaType< ::QLowEnergyServiceData >("QLowEnergyServiceData");
    qRegisterMetaType< ::QLowEnergyServiceData::ServiceType >("QLowEnergyServiceData::ServiceType");
}
