// WARNING: Please don't edit this file. It was generated by Python/WinRT v2.1.0

#include "py.Windows.Gaming.Input.Preview.h"

namespace py::cpp::Windows::Gaming::Input::Preview
{
    // ----- GameControllerProviderInfo class --------------------

    static PyObject* _new_GameControllerProviderInfo(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Gaming::Input::Preview::GameControllerProviderInfo>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Gaming::Input::Preview::GameControllerProviderInfo>::type_name);
        return nullptr;
    }

    static PyObject* GameControllerProviderInfo_GetParentProviderId(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Input.Preview.GameControllerProviderInfo", L"GetParentProviderId", 1))
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Gaming::Input::Custom::IGameControllerProvider>(args, 0);

                return py::convert(winrt::Windows::Gaming::Input::Preview::GameControllerProviderInfo::GetParentProviderId(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* GameControllerProviderInfo_GetProviderId(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Input.Preview.GameControllerProviderInfo", L"GetProviderId", 1))
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Gaming::Input::Custom::IGameControllerProvider>(args, 0);

                return py::convert(winrt::Windows::Gaming::Input::Preview::GameControllerProviderInfo::GetProviderId(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyMethodDef _methods_GameControllerProviderInfo[] = {
        { }
    };

    static PyGetSetDef _getset_GameControllerProviderInfo[] = {
        { }
    };

    static PyType_Slot _type_slots_GameControllerProviderInfo[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_GameControllerProviderInfo) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_GameControllerProviderInfo) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_GameControllerProviderInfo) },
        { }
    };

    static PyType_Spec type_spec_GameControllerProviderInfo = {
        "winrt._winrt_windows_gaming_input_preview.GameControllerProviderInfo",
        0,
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_GameControllerProviderInfo};

    static PyGetSetDef getset_GameControllerProviderInfo_Static[] = {
        { }
    };

    static PyMethodDef methods_GameControllerProviderInfo_Static[] = {
        { "get_parent_provider_id", reinterpret_cast<PyCFunction>(GameControllerProviderInfo_GetParentProviderId), METH_VARARGS, nullptr },
        { "get_provider_id", reinterpret_cast<PyCFunction>(GameControllerProviderInfo_GetProviderId), METH_VARARGS, nullptr },
        { }
    };

    static PyType_Slot type_slots_GameControllerProviderInfo_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_GameControllerProviderInfo_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_GameControllerProviderInfo_Static) },
        { }
    };

    static PyType_Spec type_spec_GameControllerProviderInfo_Static =
    {
        "winrt._winrt_windows_gaming_input_preview.GameControllerProviderInfo_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_GameControllerProviderInfo_Static
    };

    // ----- LegacyGipGameControllerProvider class --------------------

    static PyObject* _new_LegacyGipGameControllerProvider(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider>::type_name);
        return nullptr;
    }

    static void _dealloc_LegacyGipGameControllerProvider(py::wrapper::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* LegacyGipGameControllerProvider_ClearPairing(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"ClearPairing", 2))
                {
                    py::set_arg_count_version_error(2);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::System::User>(args, 0);
                auto param1 = py::convert_to<winrt::hstring>(args, 1);

                winrt::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider::ClearPairing(param0, param1);
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_ExecuteCommand(py::wrapper::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"ExecuteCommand", 1))
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Gaming::Input::Preview::DeviceCommand>(args, 0);

                self->obj.ExecuteCommand(param0);
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_FromGameController(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"FromGameController", 1))
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Gaming::Input::IGameController>(args, 0);

                return py::convert(winrt::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider::FromGameController(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_FromGameControllerProvider(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"FromGameControllerProvider", 1))
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Gaming::Input::Custom::IGameControllerProvider>(args, 0);

                return py::convert(winrt::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider::FromGameControllerProvider(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_GetDeviceFirmwareCorruptionState(py::wrapper::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"GetDeviceFirmwareCorruptionState", 0))
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                return py::convert(self->obj.GetDeviceFirmwareCorruptionState());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_GetExtendedDeviceInfo(py::wrapper::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"GetExtendedDeviceInfo", 0))
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                return py::convert(self->obj.GetExtendedDeviceInfo());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_GetHeadsetOperation(py::wrapper::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"GetHeadsetOperation", 1))
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Gaming::Input::Preview::HeadsetOperation>(args, 0);

                return py::convert(self->obj.GetHeadsetOperation(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_GetStandardControllerButtonRemapping(py::wrapper::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"GetStandardControllerButtonRemapping", 2))
                {
                    py::set_arg_count_version_error(2);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::System::User>(args, 0);
                auto param1 = py::convert_to<bool>(args, 1);

                return py::convert(self->obj.GetStandardControllerButtonRemapping(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_IsCopilot(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"IsCopilot", 2))
                {
                    py::set_arg_count_version_error(2);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::System::User>(args, 0);
                auto param1 = py::convert_to<winrt::hstring>(args, 1);

                return py::convert(winrt::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider::IsCopilot(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_IsInterfaceSupported(py::wrapper::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"IsInterfaceSupported", 1))
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::guid>(args, 0);

                return py::convert(self->obj.IsInterfaceSupported(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_IsPilot(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"IsPilot", 2))
                {
                    py::set_arg_count_version_error(2);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::System::User>(args, 0);
                auto param1 = py::convert_to<winrt::hstring>(args, 1);

                return py::convert(winrt::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider::IsPilot(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_PairPilotToCopilot(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 3)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"PairPilotToCopilot", 3))
                {
                    py::set_arg_count_version_error(3);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::System::User>(args, 0);
                auto param1 = py::convert_to<winrt::hstring>(args, 1);
                auto param2 = py::convert_to<winrt::hstring>(args, 2);

                winrt::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider::PairPilotToCopilot(param0, param1, param2);
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_SetHeadsetOperation(py::wrapper::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"SetHeadsetOperation", 2))
                {
                    py::set_arg_count_version_error(2);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Gaming::Input::Preview::HeadsetOperation>(args, 0);
                auto param1 = py::convert_to<py::pybuf_view<uint8_t, false>>(args, 1);

                self->obj.SetHeadsetOperation(param0, param1);
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_SetHomeLedIntensity(py::wrapper::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"SetHomeLedIntensity", 1))
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<uint8_t>(args, 0);

                self->obj.SetHomeLedIntensity(param0);
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_SetStandardControllerButtonRemapping(py::wrapper::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 3)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"SetStandardControllerButtonRemapping", 3))
                {
                    py::set_arg_count_version_error(3);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::System::User>(args, 0);
                auto param1 = py::convert_to<bool>(args, 1);
                auto param2 = py::convert_to<winrt::Windows::Foundation::Collections::IMapView<winrt::Windows::Gaming::Input::Preview::RemappingButtonCategory, winrt::Windows::Foundation::IInspectable>>(args, 2);

                self->obj.SetStandardControllerButtonRemapping(param0, param1, param2);
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_get_AppCompatVersion(py::wrapper::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"AppCompatVersion"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.AppCompatVersion());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_get_BatteryChargingState(py::wrapper::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"BatteryChargingState"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.BatteryChargingState());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_get_BatteryKind(py::wrapper::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"BatteryKind"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.BatteryKind());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_get_BatteryLevel(py::wrapper::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"BatteryLevel"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.BatteryLevel());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_get_IsFirmwareCorrupted(py::wrapper::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"IsFirmwareCorrupted"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.IsFirmwareCorrupted());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_get_IsSyntheticDevice(py::wrapper::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"IsSyntheticDevice"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.IsSyntheticDevice());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* LegacyGipGameControllerProvider_get_PreferredTypes(py::wrapper::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Input.Preview.LegacyGipGameControllerProvider", L"PreferredTypes"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.PreferredTypes());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_LegacyGipGameControllerProvider(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_LegacyGipGameControllerProvider(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_LegacyGipGameControllerProvider[] = {
        { "execute_command", reinterpret_cast<PyCFunction>(LegacyGipGameControllerProvider_ExecuteCommand), METH_VARARGS, nullptr },
        { "get_device_firmware_corruption_state", reinterpret_cast<PyCFunction>(LegacyGipGameControllerProvider_GetDeviceFirmwareCorruptionState), METH_VARARGS, nullptr },
        { "get_extended_device_info", reinterpret_cast<PyCFunction>(LegacyGipGameControllerProvider_GetExtendedDeviceInfo), METH_VARARGS, nullptr },
        { "get_headset_operation", reinterpret_cast<PyCFunction>(LegacyGipGameControllerProvider_GetHeadsetOperation), METH_VARARGS, nullptr },
        { "get_standard_controller_button_remapping", reinterpret_cast<PyCFunction>(LegacyGipGameControllerProvider_GetStandardControllerButtonRemapping), METH_VARARGS, nullptr },
        { "is_interface_supported", reinterpret_cast<PyCFunction>(LegacyGipGameControllerProvider_IsInterfaceSupported), METH_VARARGS, nullptr },
        { "set_headset_operation", reinterpret_cast<PyCFunction>(LegacyGipGameControllerProvider_SetHeadsetOperation), METH_VARARGS, nullptr },
        { "set_home_led_intensity", reinterpret_cast<PyCFunction>(LegacyGipGameControllerProvider_SetHomeLedIntensity), METH_VARARGS, nullptr },
        { "set_standard_controller_button_remapping", reinterpret_cast<PyCFunction>(LegacyGipGameControllerProvider_SetStandardControllerButtonRemapping), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_LegacyGipGameControllerProvider, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_LegacyGipGameControllerProvider), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_LegacyGipGameControllerProvider[] = {
        { "app_compat_version", reinterpret_cast<getter>(LegacyGipGameControllerProvider_get_AppCompatVersion), nullptr, nullptr, nullptr },
        { "battery_charging_state", reinterpret_cast<getter>(LegacyGipGameControllerProvider_get_BatteryChargingState), nullptr, nullptr, nullptr },
        { "battery_kind", reinterpret_cast<getter>(LegacyGipGameControllerProvider_get_BatteryKind), nullptr, nullptr, nullptr },
        { "battery_level", reinterpret_cast<getter>(LegacyGipGameControllerProvider_get_BatteryLevel), nullptr, nullptr, nullptr },
        { "is_firmware_corrupted", reinterpret_cast<getter>(LegacyGipGameControllerProvider_get_IsFirmwareCorrupted), nullptr, nullptr, nullptr },
        { "is_synthetic_device", reinterpret_cast<getter>(LegacyGipGameControllerProvider_get_IsSyntheticDevice), nullptr, nullptr, nullptr },
        { "preferred_types", reinterpret_cast<getter>(LegacyGipGameControllerProvider_get_PreferredTypes), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_LegacyGipGameControllerProvider[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_LegacyGipGameControllerProvider) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_LegacyGipGameControllerProvider) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_LegacyGipGameControllerProvider) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_LegacyGipGameControllerProvider) },
        { }
    };

    static PyType_Spec type_spec_LegacyGipGameControllerProvider = {
        "winrt._winrt_windows_gaming_input_preview.LegacyGipGameControllerProvider",
        sizeof(py::wrapper::Windows::Gaming::Input::Preview::LegacyGipGameControllerProvider),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_LegacyGipGameControllerProvider};

    static PyGetSetDef getset_LegacyGipGameControllerProvider_Static[] = {
        { }
    };

    static PyMethodDef methods_LegacyGipGameControllerProvider_Static[] = {
        { "clear_pairing", reinterpret_cast<PyCFunction>(LegacyGipGameControllerProvider_ClearPairing), METH_VARARGS, nullptr },
        { "from_game_controller", reinterpret_cast<PyCFunction>(LegacyGipGameControllerProvider_FromGameController), METH_VARARGS, nullptr },
        { "from_game_controller_provider", reinterpret_cast<PyCFunction>(LegacyGipGameControllerProvider_FromGameControllerProvider), METH_VARARGS, nullptr },
        { "is_copilot", reinterpret_cast<PyCFunction>(LegacyGipGameControllerProvider_IsCopilot), METH_VARARGS, nullptr },
        { "is_pilot", reinterpret_cast<PyCFunction>(LegacyGipGameControllerProvider_IsPilot), METH_VARARGS, nullptr },
        { "pair_pilot_to_copilot", reinterpret_cast<PyCFunction>(LegacyGipGameControllerProvider_PairPilotToCopilot), METH_VARARGS, nullptr },
        { }
    };

    static PyType_Slot type_slots_LegacyGipGameControllerProvider_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_LegacyGipGameControllerProvider_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_LegacyGipGameControllerProvider_Static) },
        { }
    };

    static PyType_Spec type_spec_LegacyGipGameControllerProvider_Static =
    {
        "winrt._winrt_windows_gaming_input_preview.LegacyGipGameControllerProvider_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_LegacyGipGameControllerProvider_Static
    };

    // ----- HeadsetGeqGains struct --------------------

    winrt_struct_wrapper<winrt::Windows::Gaming::Input::Preview::HeadsetGeqGains>* _new_HeadsetGeqGains(PyTypeObject* subclass, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        auto self = reinterpret_cast<winrt_struct_wrapper<winrt::Windows::Gaming::Input::Preview::HeadsetGeqGains>*>(subclass->tp_alloc(subclass, 0));

        if (!self)
        {
            return nullptr;
        }

        std::construct_at(&self->obj);

        return self;
    }

    int _init_HeadsetGeqGains(winrt_struct_wrapper<winrt::Windows::Gaming::Input::Preview::HeadsetGeqGains>* self, PyObject* args, PyObject* kwds) noexcept
    {
        auto tuple_size = PyTuple_Size(args);

        if ((tuple_size == 0) && (kwds == nullptr))
        {
            self->obj = {};
            return 0;
        }

        int32_t _band1Gain{};
        int32_t _band2Gain{};
        int32_t _band3Gain{};
        int32_t _band4Gain{};
        int32_t _band5Gain{};

        static const char* kwlist[] = {"band1_gain", "band2_gain", "band3_gain", "band4_gain", "band5_gain", nullptr};
        if (!PyArg_ParseTupleAndKeywords(args, kwds, "iiiii", const_cast<char**>(kwlist), &_band1Gain, &_band2Gain, &_band3Gain, &_band4Gain, &_band5Gain))
        {
            return -1;
        }

        try
        {
            self->obj.band1Gain = _band1Gain;
            self->obj.band2Gain = _band2Gain;
            self->obj.band3Gain = _band3Gain;
            self->obj.band4Gain = _band4Gain;
            self->obj.band5Gain = _band5Gain;

            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static void _dealloc_HeadsetGeqGains(py::wrapper::Windows::Gaming::Input::Preview::HeadsetGeqGains* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* _assign_array_HeadsetGeqGains(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Gaming::Input::Preview::HeadsetGeqGains>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyMethodDef _methods_HeadsetGeqGains[] = {
        { "_assign_array_", _assign_array_HeadsetGeqGains, METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyObject* HeadsetGeqGains_get_band1Gain(py::wrapper::Windows::Gaming::Input::Preview::HeadsetGeqGains* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.band1Gain);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int HeadsetGeqGains_set_band1Gain(py::wrapper::Windows::Gaming::Input::Preview::HeadsetGeqGains* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.band1Gain = py::converter<int32_t>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* HeadsetGeqGains_get_band2Gain(py::wrapper::Windows::Gaming::Input::Preview::HeadsetGeqGains* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.band2Gain);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int HeadsetGeqGains_set_band2Gain(py::wrapper::Windows::Gaming::Input::Preview::HeadsetGeqGains* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.band2Gain = py::converter<int32_t>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* HeadsetGeqGains_get_band3Gain(py::wrapper::Windows::Gaming::Input::Preview::HeadsetGeqGains* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.band3Gain);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int HeadsetGeqGains_set_band3Gain(py::wrapper::Windows::Gaming::Input::Preview::HeadsetGeqGains* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.band3Gain = py::converter<int32_t>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* HeadsetGeqGains_get_band4Gain(py::wrapper::Windows::Gaming::Input::Preview::HeadsetGeqGains* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.band4Gain);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int HeadsetGeqGains_set_band4Gain(py::wrapper::Windows::Gaming::Input::Preview::HeadsetGeqGains* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.band4Gain = py::converter<int32_t>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* HeadsetGeqGains_get_band5Gain(py::wrapper::Windows::Gaming::Input::Preview::HeadsetGeqGains* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.band5Gain);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int HeadsetGeqGains_set_band5Gain(py::wrapper::Windows::Gaming::Input::Preview::HeadsetGeqGains* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.band5Gain = py::converter<int32_t>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyGetSetDef _getset_HeadsetGeqGains[] = {
        { "band1_gain", reinterpret_cast<getter>(HeadsetGeqGains_get_band1Gain), reinterpret_cast<setter>(HeadsetGeqGains_set_band1Gain), nullptr, nullptr },
        { "band2_gain", reinterpret_cast<getter>(HeadsetGeqGains_get_band2Gain), reinterpret_cast<setter>(HeadsetGeqGains_set_band2Gain), nullptr, nullptr },
        { "band3_gain", reinterpret_cast<getter>(HeadsetGeqGains_get_band3Gain), reinterpret_cast<setter>(HeadsetGeqGains_set_band3Gain), nullptr, nullptr },
        { "band4_gain", reinterpret_cast<getter>(HeadsetGeqGains_get_band4Gain), reinterpret_cast<setter>(HeadsetGeqGains_set_band4Gain), nullptr, nullptr },
        { "band5_gain", reinterpret_cast<getter>(HeadsetGeqGains_get_band5Gain), reinterpret_cast<setter>(HeadsetGeqGains_set_band5Gain), nullptr, nullptr },
        { }
    };

    static PyObject* _richcompare_HeadsetGeqGains(py::wrapper::Windows::Gaming::Input::Preview::HeadsetGeqGains* self, PyObject* other, int op) noexcept
    {
        try
        {
            auto _other = py::converter<winrt::Windows::Gaming::Input::Preview::HeadsetGeqGains>::convert_to(other);

            if (op == Py_EQ)
            {
                if (self->obj == _other)
                {
                    Py_RETURN_TRUE;
                }

                Py_RETURN_FALSE;
            }

            if (op == Py_NE)
            {
                if (self->obj != _other)
                {
                    Py_RETURN_TRUE;
                }

                Py_RETURN_FALSE;
            }

            Py_RETURN_NOTIMPLEMENTED;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyType_Slot _type_slots_HeadsetGeqGains[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_HeadsetGeqGains) },
        { Py_tp_init, reinterpret_cast<void*>(_init_HeadsetGeqGains) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_HeadsetGeqGains) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_HeadsetGeqGains) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_HeadsetGeqGains) },
        { Py_tp_richcompare, reinterpret_cast<void*>(_richcompare_HeadsetGeqGains) },
        { }
    };

    static PyType_Spec type_spec_HeadsetGeqGains = {
        "winrt._winrt_windows_gaming_input_preview.HeadsetGeqGains",
        sizeof(py::wrapper::Windows::Gaming::Input::Preview::HeadsetGeqGains),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_HeadsetGeqGains};

    // ----- Windows.Gaming.Input.Preview Initialization --------------------

    PyDoc_STRVAR(module_doc, "Windows.Gaming.Input.Preview");

    static PyModuleDef module_def = {
        PyModuleDef_HEAD_INIT,
        "_winrt_windows_gaming_input_preview",
        module_doc,
        0,
        nullptr,
        nullptr,
        nullptr,
        nullptr,
        nullptr};
} // py::cpp::Windows::Gaming::Input::Preview

PyMODINIT_FUNC PyInit__winrt_windows_gaming_input_preview(void) noexcept
{
    using namespace py::cpp::Windows::Gaming::Input::Preview;

    if (py::import_winrt_runtime() == -1)
    {
        return nullptr;
    }

    py::pyobj_handle module{PyModule_Create(&module_def)};

    if (!module)
    {
        return nullptr;
    }

    auto object_type = py::get_object_type();
    if (!object_type)
    {
        return nullptr;
    }

    py::pyobj_handle object_bases{PyTuple_Pack(1, object_type)};

    if (!object_bases)
    {
        return nullptr;
    }

    py::pyobj_handle type_GameControllerProviderInfo_Static{PyType_FromSpec(&type_spec_GameControllerProviderInfo_Static)};
    if (!type_GameControllerProviderInfo_Static)
    {
        return nullptr;
    }

    if (py::register_python_type(module.get(), &type_spec_GameControllerProviderInfo, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_GameControllerProviderInfo_Static.get())) == -1)
    {
        return nullptr;
    }

    py::pyobj_handle type_LegacyGipGameControllerProvider_Static{PyType_FromSpec(&type_spec_LegacyGipGameControllerProvider_Static)};
    if (!type_LegacyGipGameControllerProvider_Static)
    {
        return nullptr;
    }

    if (py::register_python_type(module.get(), &type_spec_LegacyGipGameControllerProvider, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_LegacyGipGameControllerProvider_Static.get())) == -1)
    {
        return nullptr;
    }

    if (py::register_python_type(module.get(), &type_spec_HeadsetGeqGains, nullptr, nullptr) == -1)
    {
        return nullptr;
    }


    return module.detach();
}
