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

#include "py.Microsoft.UI.Input.DragDrop.h"

namespace py::cpp::Microsoft::UI::Input::DragDrop
{
    // ----- DragDropManager class --------------------

    static PyObject* _new_DragDropManager(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Microsoft::UI::Input::DragDrop::DragDropManager>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Microsoft::UI::Input::DragDrop::DragDropManager>::type_name);
        return nullptr;
    }

    static void _dealloc_DragDropManager(py::wrapper::Microsoft::UI::Input::DragDrop::DragDropManager* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* DragDropManager_Close(py::wrapper::Microsoft::UI::Input::DragDrop::DragDropManager* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 0)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Input.DragDrop.DragDropManager", L"Close", 0);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                {
                    auto _gil = release_gil();
                    self->obj.Close();
                }

                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DragDropManager_GetForIsland(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 1)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Input.DragDrop.DragDropManager", L"GetForIsland", 1);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Microsoft::UI::Content::ContentIsland>(args, 0);

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return winrt::Microsoft::UI::Input::DragDrop::DragDropManager::GetForIsland(param0);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DragDropManager_get_AreConcurrentOperationsEnabled(py::wrapper::Microsoft::UI::Input::DragDrop::DragDropManager* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Input.DragDrop.DragDropManager", L"AreConcurrentOperationsEnabled");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.AreConcurrentOperationsEnabled();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int DragDropManager_put_AreConcurrentOperationsEnabled(py::wrapper::Microsoft::UI::Input::DragDrop::DragDropManager* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Input.DragDrop.DragDropManager", L"AreConcurrentOperationsEnabled");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<bool>(arg);

            {
                auto _gil = release_gil();
                self->obj.AreConcurrentOperationsEnabled(param0);
            }

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

    static PyObject* DragDropManager_add_TargetRequested(py::wrapper::Microsoft::UI::Input::DragDrop::DragDropManager* self, PyObject* arg) noexcept
    {
        try
        {
            static std::optional<bool> is_event_present{};

            if (!is_event_present.has_value())
            {
                is_event_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Microsoft.UI.Input.DragDrop.DragDropManager", L"TargetRequested");
            }

            if (!is_event_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
                return nullptr;
            }

            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Microsoft::UI::Input::DragDrop::DragDropManager, winrt::Microsoft::UI::Input::DragDrop::DropOperationTargetRequestedEventArgs>>(arg);

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.TargetRequested(param0);
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DragDropManager_remove_TargetRequested(py::wrapper::Microsoft::UI::Input::DragDrop::DragDropManager* self, PyObject* arg) noexcept
    {
        try
        {
            static std::optional<bool> is_event_present{};

            if (!is_event_present.has_value())
            {
                is_event_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Microsoft.UI.Input.DragDrop.DragDropManager", L"TargetRequested");
            }

            if (!is_event_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
                return nullptr;
            }

            auto param0 = py::convert_to<winrt::event_token>(arg);

            {
                auto _gil = release_gil();
                self->obj.TargetRequested(param0);
            }

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

    static PyObject* _assign_array_DragDropManager(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Microsoft::UI::Input::DragDrop::DragDropManager>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_DragDropManager(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Microsoft::UI::Input::DragDrop::DragDropManager>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _enter_DragDropManager(py::wrapper::Microsoft::UI::Input::DragDrop::DragDropManager* self, PyObject* /*unused*/) noexcept
    {
        return Py_NewRef(self);
    }

    static PyObject* _exit_DragDropManager(py::wrapper::Microsoft::UI::Input::DragDrop::DragDropManager* self, PyObject* /*unused*/) noexcept
    {
        try
        {
            {
                auto _gil = py::release_gil();
                self->obj.Close();
            }

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

    static PyMethodDef _methods_DragDropManager[] = {
        { "close", reinterpret_cast<PyCFunction>(DragDropManager_Close), METH_VARARGS, nullptr },
        { "add_target_requested", reinterpret_cast<PyCFunction>(DragDropManager_add_TargetRequested), METH_O, nullptr },
        { "remove_target_requested", reinterpret_cast<PyCFunction>(DragDropManager_remove_TargetRequested), METH_O, nullptr },
        { "_assign_array_", _assign_array_DragDropManager, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DragDropManager), METH_O | METH_STATIC, nullptr },
        { "__enter__", reinterpret_cast<PyCFunction>(_enter_DragDropManager), METH_NOARGS, nullptr },
        { "__exit__", reinterpret_cast<PyCFunction>(_exit_DragDropManager), METH_VARARGS, nullptr },
        { }};

    static PyGetSetDef _getset_DragDropManager[] = {
        { "are_concurrent_operations_enabled", reinterpret_cast<getter>(DragDropManager_get_AreConcurrentOperationsEnabled), reinterpret_cast<setter>(DragDropManager_put_AreConcurrentOperationsEnabled), nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_DragDropManager[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_DragDropManager) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DragDropManager) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DragDropManager) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DragDropManager) },
        { }};

    static PyType_Spec type_spec_DragDropManager = {
        "winui3._winui3_microsoft_ui_input_dragdrop.DragDropManager",
        sizeof(py::wrapper::Microsoft::UI::Input::DragDrop::DragDropManager),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DragDropManager};

    static PyGetSetDef getset_DragDropManager_Static[] = {
        { }};

    static PyMethodDef methods_DragDropManager_Static[] = {
        { "get_for_island", reinterpret_cast<PyCFunction>(DragDropManager_GetForIsland), METH_VARARGS, nullptr },
        { }};

    static PyType_Slot type_slots_DragDropManager_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_DragDropManager_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_DragDropManager_Static) },
        { }
    };

    static PyType_Spec type_spec_DragDropManager_Static = {
        "winui3._winui3_microsoft_ui_input_dragdrop.DragDropManager_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_DragDropManager_Static};

    // ----- DragInfo class --------------------

    static PyObject* _new_DragInfo(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Microsoft::UI::Input::DragDrop::DragInfo>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Microsoft::UI::Input::DragDrop::DragInfo>::type_name);
        return nullptr;
    }

    static void _dealloc_DragInfo(py::wrapper::Microsoft::UI::Input::DragDrop::DragInfo* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* DragInfo_get_AllowedOperations(py::wrapper::Microsoft::UI::Input::DragDrop::DragInfo* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Input.DragDrop.DragInfo", L"AllowedOperations");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.AllowedOperations();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DragInfo_get_Data(py::wrapper::Microsoft::UI::Input::DragDrop::DragInfo* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Input.DragDrop.DragInfo", L"Data");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Data();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DragInfo_get_Modifiers(py::wrapper::Microsoft::UI::Input::DragDrop::DragInfo* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Input.DragDrop.DragInfo", L"Modifiers");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Modifiers();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DragInfo_get_Position(py::wrapper::Microsoft::UI::Input::DragDrop::DragInfo* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Input.DragDrop.DragInfo", L"Position");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Position();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_DragInfo(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Microsoft::UI::Input::DragDrop::DragInfo>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_DragInfo(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Microsoft::UI::Input::DragDrop::DragInfo>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_DragInfo[] = {
        { "_assign_array_", _assign_array_DragInfo, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DragInfo), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_DragInfo[] = {
        { "allowed_operations", reinterpret_cast<getter>(DragInfo_get_AllowedOperations), nullptr, nullptr, nullptr },
        { "data", reinterpret_cast<getter>(DragInfo_get_Data), nullptr, nullptr, nullptr },
        { "modifiers", reinterpret_cast<getter>(DragInfo_get_Modifiers), nullptr, nullptr, nullptr },
        { "position", reinterpret_cast<getter>(DragInfo_get_Position), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_DragInfo[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_DragInfo) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DragInfo) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DragInfo) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DragInfo) },
        { }};

    static PyType_Spec type_spec_DragInfo = {
        "winui3._winui3_microsoft_ui_input_dragdrop.DragInfo",
        sizeof(py::wrapper::Microsoft::UI::Input::DragDrop::DragInfo),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DragInfo};

    // ----- DragOperation class --------------------

    static PyObject* _new_DragOperation(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        if (kwds)
        {
            py::set_invalid_kwd_args_error();
            return nullptr;
        }

        auto arg_count = PyTuple_GET_SIZE(args);
        if (arg_count == 0)
        {
            try
            {
                winrt::Microsoft::UI::Input::DragDrop::DragOperation instance{};
                return py::wrap(instance, type);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static void _dealloc_DragOperation(py::wrapper::Microsoft::UI::Input::DragDrop::DragOperation* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* DragOperation_Close(py::wrapper::Microsoft::UI::Input::DragDrop::DragOperation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 0)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Input.DragDrop.DragOperation", L"Close", 0);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                {
                    auto _gil = release_gil();
                    self->obj.Close();
                }

                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DragOperation_SetDragUIContentFromSoftwareBitmap(py::wrapper::Microsoft::UI::Input::DragDrop::DragOperation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 1)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Input.DragDrop.DragOperation", L"SetDragUIContentFromSoftwareBitmap", 1);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Graphics::Imaging::SoftwareBitmap>(args, 0);

                {
                    auto _gil = release_gil();
                    self->obj.SetDragUIContentFromSoftwareBitmap(param0);
                }

                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DragOperation_SetDragUIContentFromSoftwareBitmap2(py::wrapper::Microsoft::UI::Input::DragDrop::DragOperation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 2)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Input.DragDrop.DragOperation", L"SetDragUIContentFromSoftwareBitmap", 2);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(2);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Graphics::Imaging::SoftwareBitmap>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::Point>(args, 1);

                {
                    auto _gil = release_gil();
                    self->obj.SetDragUIContentFromSoftwareBitmap(param0, param1);
                }

                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DragOperation_StartAsync(py::wrapper::Microsoft::UI::Input::DragDrop::DragOperation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 2)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Input.DragDrop.DragOperation", L"StartAsync", 2);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(2);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Microsoft::UI::Input::DragDrop::DragDropManager>(args, 0);
                auto param1 = py::convert_to<winrt::Microsoft::UI::Input::PointerPoint>(args, 1);

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.StartAsync(param0, param1);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DragOperation_get_DragUIContentMode(py::wrapper::Microsoft::UI::Input::DragDrop::DragOperation* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Input.DragDrop.DragOperation", L"DragUIContentMode");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.DragUIContentMode();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int DragOperation_put_DragUIContentMode(py::wrapper::Microsoft::UI::Input::DragDrop::DragOperation* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Input.DragDrop.DragOperation", L"DragUIContentMode");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Microsoft::UI::Input::DragDrop::DragUIContentMode>(arg);

            {
                auto _gil = release_gil();
                self->obj.DragUIContentMode(param0);
            }

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

    static PyObject* DragOperation_get_AllowedOperations(py::wrapper::Microsoft::UI::Input::DragDrop::DragOperation* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Input.DragDrop.DragOperation", L"AllowedOperations");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.AllowedOperations();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int DragOperation_put_AllowedOperations(py::wrapper::Microsoft::UI::Input::DragDrop::DragOperation* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Input.DragDrop.DragOperation", L"AllowedOperations");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::ApplicationModel::DataTransfer::DataPackageOperation>(arg);

            {
                auto _gil = release_gil();
                self->obj.AllowedOperations(param0);
            }

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

    static PyObject* DragOperation_get_Data(py::wrapper::Microsoft::UI::Input::DragDrop::DragOperation* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Input.DragDrop.DragOperation", L"Data");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Data();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_DragOperation(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Microsoft::UI::Input::DragDrop::DragOperation>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_DragOperation(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Microsoft::UI::Input::DragDrop::DragOperation>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _enter_DragOperation(py::wrapper::Microsoft::UI::Input::DragDrop::DragOperation* self, PyObject* /*unused*/) noexcept
    {
        return Py_NewRef(self);
    }

    static PyObject* _exit_DragOperation(py::wrapper::Microsoft::UI::Input::DragDrop::DragOperation* self, PyObject* /*unused*/) noexcept
    {
        try
        {
            {
                auto _gil = py::release_gil();
                self->obj.Close();
            }

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

    static PyMethodDef _methods_DragOperation[] = {
        { "close", reinterpret_cast<PyCFunction>(DragOperation_Close), METH_VARARGS, nullptr },
        { "set_drag_ui_content_from_software_bitmap", reinterpret_cast<PyCFunction>(DragOperation_SetDragUIContentFromSoftwareBitmap), METH_VARARGS, nullptr },
        { "set_drag_ui_content_from_software_bitmap2", reinterpret_cast<PyCFunction>(DragOperation_SetDragUIContentFromSoftwareBitmap2), METH_VARARGS, nullptr },
        { "start_async", reinterpret_cast<PyCFunction>(DragOperation_StartAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_DragOperation, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DragOperation), METH_O | METH_STATIC, nullptr },
        { "__enter__", reinterpret_cast<PyCFunction>(_enter_DragOperation), METH_NOARGS, nullptr },
        { "__exit__", reinterpret_cast<PyCFunction>(_exit_DragOperation), METH_VARARGS, nullptr },
        { }};

    static PyGetSetDef _getset_DragOperation[] = {
        { "drag_ui_content_mode", reinterpret_cast<getter>(DragOperation_get_DragUIContentMode), reinterpret_cast<setter>(DragOperation_put_DragUIContentMode), nullptr, nullptr },
        { "allowed_operations", reinterpret_cast<getter>(DragOperation_get_AllowedOperations), reinterpret_cast<setter>(DragOperation_put_AllowedOperations), nullptr, nullptr },
        { "data", reinterpret_cast<getter>(DragOperation_get_Data), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_DragOperation[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_DragOperation) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DragOperation) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DragOperation) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DragOperation) },
        { }};

    static PyType_Spec type_spec_DragOperation = {
        "winui3._winui3_microsoft_ui_input_dragdrop.DragOperation",
        sizeof(py::wrapper::Microsoft::UI::Input::DragDrop::DragOperation),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DragOperation};

    // ----- DragUIOverride class --------------------

    static PyObject* _new_DragUIOverride(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Microsoft::UI::Input::DragDrop::DragUIOverride>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Microsoft::UI::Input::DragDrop::DragUIOverride>::type_name);
        return nullptr;
    }

    static void _dealloc_DragUIOverride(py::wrapper::Microsoft::UI::Input::DragDrop::DragUIOverride* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* DragUIOverride_Clear(py::wrapper::Microsoft::UI::Input::DragDrop::DragUIOverride* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 0)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Input.DragDrop.DragUIOverride", L"Clear", 0);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                {
                    auto _gil = release_gil();
                    self->obj.Clear();
                }

                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DragUIOverride_SetContentFromSoftwareBitmap(py::wrapper::Microsoft::UI::Input::DragDrop::DragUIOverride* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 1)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Input.DragDrop.DragUIOverride", L"SetContentFromSoftwareBitmap", 1);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Graphics::Imaging::SoftwareBitmap>(args, 0);

                {
                    auto _gil = release_gil();
                    self->obj.SetContentFromSoftwareBitmap(param0);
                }

                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DragUIOverride_SetContentFromSoftwareBitmap2(py::wrapper::Microsoft::UI::Input::DragDrop::DragUIOverride* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 2)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Input.DragDrop.DragUIOverride", L"SetContentFromSoftwareBitmap", 2);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(2);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Graphics::Imaging::SoftwareBitmap>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::Point>(args, 1);

                {
                    auto _gil = release_gil();
                    self->obj.SetContentFromSoftwareBitmap(param0, param1);
                }

                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DragUIOverride_get_IsGlyphVisible(py::wrapper::Microsoft::UI::Input::DragDrop::DragUIOverride* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Input.DragDrop.DragUIOverride", L"IsGlyphVisible");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.IsGlyphVisible();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int DragUIOverride_put_IsGlyphVisible(py::wrapper::Microsoft::UI::Input::DragDrop::DragUIOverride* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Input.DragDrop.DragUIOverride", L"IsGlyphVisible");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<bool>(arg);

            {
                auto _gil = release_gil();
                self->obj.IsGlyphVisible(param0);
            }

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

    static PyObject* DragUIOverride_get_IsContentVisible(py::wrapper::Microsoft::UI::Input::DragDrop::DragUIOverride* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Input.DragDrop.DragUIOverride", L"IsContentVisible");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.IsContentVisible();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int DragUIOverride_put_IsContentVisible(py::wrapper::Microsoft::UI::Input::DragDrop::DragUIOverride* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Input.DragDrop.DragUIOverride", L"IsContentVisible");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<bool>(arg);

            {
                auto _gil = release_gil();
                self->obj.IsContentVisible(param0);
            }

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

    static PyObject* DragUIOverride_get_IsCaptionVisible(py::wrapper::Microsoft::UI::Input::DragDrop::DragUIOverride* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Input.DragDrop.DragUIOverride", L"IsCaptionVisible");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.IsCaptionVisible();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int DragUIOverride_put_IsCaptionVisible(py::wrapper::Microsoft::UI::Input::DragDrop::DragUIOverride* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Input.DragDrop.DragUIOverride", L"IsCaptionVisible");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<bool>(arg);

            {
                auto _gil = release_gil();
                self->obj.IsCaptionVisible(param0);
            }

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

    static PyObject* DragUIOverride_get_Caption(py::wrapper::Microsoft::UI::Input::DragDrop::DragUIOverride* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Input.DragDrop.DragUIOverride", L"Caption");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Caption();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int DragUIOverride_put_Caption(py::wrapper::Microsoft::UI::Input::DragDrop::DragUIOverride* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Input.DragDrop.DragUIOverride", L"Caption");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::hstring>(arg);

            {
                auto _gil = release_gil();
                self->obj.Caption(param0);
            }

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

    static PyObject* _assign_array_DragUIOverride(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Microsoft::UI::Input::DragDrop::DragUIOverride>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_DragUIOverride(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Microsoft::UI::Input::DragDrop::DragUIOverride>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_DragUIOverride[] = {
        { "clear", reinterpret_cast<PyCFunction>(DragUIOverride_Clear), METH_VARARGS, nullptr },
        { "set_content_from_software_bitmap", reinterpret_cast<PyCFunction>(DragUIOverride_SetContentFromSoftwareBitmap), METH_VARARGS, nullptr },
        { "set_content_from_software_bitmap2", reinterpret_cast<PyCFunction>(DragUIOverride_SetContentFromSoftwareBitmap2), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_DragUIOverride, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DragUIOverride), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_DragUIOverride[] = {
        { "is_glyph_visible", reinterpret_cast<getter>(DragUIOverride_get_IsGlyphVisible), reinterpret_cast<setter>(DragUIOverride_put_IsGlyphVisible), nullptr, nullptr },
        { "is_content_visible", reinterpret_cast<getter>(DragUIOverride_get_IsContentVisible), reinterpret_cast<setter>(DragUIOverride_put_IsContentVisible), nullptr, nullptr },
        { "is_caption_visible", reinterpret_cast<getter>(DragUIOverride_get_IsCaptionVisible), reinterpret_cast<setter>(DragUIOverride_put_IsCaptionVisible), nullptr, nullptr },
        { "caption", reinterpret_cast<getter>(DragUIOverride_get_Caption), reinterpret_cast<setter>(DragUIOverride_put_Caption), nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_DragUIOverride[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_DragUIOverride) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DragUIOverride) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DragUIOverride) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DragUIOverride) },
        { }};

    static PyType_Spec type_spec_DragUIOverride = {
        "winui3._winui3_microsoft_ui_input_dragdrop.DragUIOverride",
        sizeof(py::wrapper::Microsoft::UI::Input::DragDrop::DragUIOverride),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DragUIOverride};

    // ----- DropOperationTargetRequestedEventArgs class --------------------

    static PyObject* _new_DropOperationTargetRequestedEventArgs(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Microsoft::UI::Input::DragDrop::DropOperationTargetRequestedEventArgs>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Microsoft::UI::Input::DragDrop::DropOperationTargetRequestedEventArgs>::type_name);
        return nullptr;
    }

    static void _dealloc_DropOperationTargetRequestedEventArgs(py::wrapper::Microsoft::UI::Input::DragDrop::DropOperationTargetRequestedEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* DropOperationTargetRequestedEventArgs_SetTarget(py::wrapper::Microsoft::UI::Input::DragDrop::DropOperationTargetRequestedEventArgs* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 1)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Input.DragDrop.DropOperationTargetRequestedEventArgs", L"SetTarget", 1);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Microsoft::UI::Input::DragDrop::IDropOperationTarget>(args, 0);

                {
                    auto _gil = release_gil();
                    self->obj.SetTarget(param0);
                }

                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* _assign_array_DropOperationTargetRequestedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Microsoft::UI::Input::DragDrop::DropOperationTargetRequestedEventArgs>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_DropOperationTargetRequestedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Microsoft::UI::Input::DragDrop::DropOperationTargetRequestedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_DropOperationTargetRequestedEventArgs[] = {
        { "set_target", reinterpret_cast<PyCFunction>(DropOperationTargetRequestedEventArgs_SetTarget), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_DropOperationTargetRequestedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DropOperationTargetRequestedEventArgs), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_DropOperationTargetRequestedEventArgs[] = {
        { }};

    static PyType_Slot _type_slots_DropOperationTargetRequestedEventArgs[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_DropOperationTargetRequestedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DropOperationTargetRequestedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DropOperationTargetRequestedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DropOperationTargetRequestedEventArgs) },
        { }};

    static PyType_Spec type_spec_DropOperationTargetRequestedEventArgs = {
        "winui3._winui3_microsoft_ui_input_dragdrop.DropOperationTargetRequestedEventArgs",
        sizeof(py::wrapper::Microsoft::UI::Input::DragDrop::DropOperationTargetRequestedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DropOperationTargetRequestedEventArgs};

    // ----- IDropOperationTarget interface --------------------

    #if PY_VERSION_HEX < 0x030A0000
    static PyObject* _new_IDropOperationTarget(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Microsoft::UI::Input::DragDrop::IDropOperationTarget>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Microsoft::UI::Input::DragDrop::IDropOperationTarget>::type_name);
        return nullptr;
    }
    #endif

    static void _dealloc_IDropOperationTarget(py::wrapper::Microsoft::UI::Input::DragDrop::IDropOperationTarget* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* IDropOperationTarget_DropAsync(py::wrapper::Microsoft::UI::Input::DragDrop::IDropOperationTarget* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 1)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Input.DragDrop.IDropOperationTarget", L"DropAsync", 1);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Microsoft::UI::Input::DragDrop::DragInfo>(args, 0);

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.DropAsync(param0);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* IDropOperationTarget_EnterAsync(py::wrapper::Microsoft::UI::Input::DragDrop::IDropOperationTarget* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 2)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Input.DragDrop.IDropOperationTarget", L"EnterAsync", 2);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(2);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Microsoft::UI::Input::DragDrop::DragInfo>(args, 0);
                auto param1 = py::convert_to<winrt::Microsoft::UI::Input::DragDrop::DragUIOverride>(args, 1);

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.EnterAsync(param0, param1);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* IDropOperationTarget_LeaveAsync(py::wrapper::Microsoft::UI::Input::DragDrop::IDropOperationTarget* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 1)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Input.DragDrop.IDropOperationTarget", L"LeaveAsync", 1);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Microsoft::UI::Input::DragDrop::DragInfo>(args, 0);

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.LeaveAsync(param0);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* IDropOperationTarget_OverAsync(py::wrapper::Microsoft::UI::Input::DragDrop::IDropOperationTarget* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 2)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Input.DragDrop.IDropOperationTarget", L"OverAsync", 2);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(2);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Microsoft::UI::Input::DragDrop::DragInfo>(args, 0);
                auto param1 = py::convert_to<winrt::Microsoft::UI::Input::DragDrop::DragUIOverride>(args, 1);

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.OverAsync(param0, param1);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyMethodDef _methods_IDropOperationTarget[] = {
        { "drop_async", reinterpret_cast<PyCFunction>(IDropOperationTarget_DropAsync), METH_VARARGS, nullptr },
        { "enter_async", reinterpret_cast<PyCFunction>(IDropOperationTarget_EnterAsync), METH_VARARGS, nullptr },
        { "leave_async", reinterpret_cast<PyCFunction>(IDropOperationTarget_LeaveAsync), METH_VARARGS, nullptr },
        { "over_async", reinterpret_cast<PyCFunction>(IDropOperationTarget_OverAsync), METH_VARARGS, nullptr },
        { }};

    static PyGetSetDef _getset_IDropOperationTarget[] = {
        { }};

    static PyType_Slot _type_slots_IDropOperationTarget[] = {
        #if PY_VERSION_HEX < 0x030A0000
        { Py_tp_new, reinterpret_cast<void*>(_new_IDropOperationTarget) },
        #endif
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IDropOperationTarget) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IDropOperationTarget) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IDropOperationTarget) },
        { }};

    static PyType_Spec type_spec_IDropOperationTarget = {
        "winui3._winui3_microsoft_ui_input_dragdrop._IDropOperationTarget",
        sizeof(py::wrapper::Microsoft::UI::Input::DragDrop::IDropOperationTarget),
        0,
        Py_TPFLAGS_DEFAULT
        #if PY_VERSION_HEX >= 0x030A0000
        | Py_TPFLAGS_DISALLOW_INSTANTIATION
        #endif
        ,
        _type_slots_IDropOperationTarget};

    struct ImplementsIDropOperationTarget : py::ImplementsInterfaceT<ImplementsIDropOperationTarget, winrt::Microsoft::UI::Input::DragDrop::IDropOperationTarget>
    {
        ImplementsIDropOperationTarget() = delete;
        ImplementsIDropOperationTarget(PyObject* py_obj, winrt::impl::inspectable_abi* runtime_class) : py::ImplementsInterfaceT<ImplementsIDropOperationTarget, winrt::Microsoft::UI::Input::DragDrop::IDropOperationTarget>(py_obj, runtime_class)
        {
        }

        auto DropAsync(winrt::Microsoft::UI::Input::DragDrop::DragInfo const& param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

                py::pyobj_handle method{PyObject_GetAttrString(self.get(), "drop_async")};
                if (!method)
                {
                    throw python_exception();
                }

                py::pyobj_handle py_param0{py::convert(param0)};
                if (!py_param0)
                {
                    throw python_exception();
                }

                py::pyobj_handle return_value{PyObject_CallOneArg(method.get(), py_param0.get())};
                if (!return_value)
                {
                    throw python_exception();
                }

                return py::convert_to<winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::ApplicationModel::DataTransfer::DataPackageOperation>>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto EnterAsync(winrt::Microsoft::UI::Input::DragDrop::DragInfo const& param0, winrt::Microsoft::UI::Input::DragDrop::DragUIOverride const& param1)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

                py::pyobj_handle method{PyObject_GetAttrString(self.get(), "enter_async")};
                if (!method)
                {
                    throw python_exception();
                }

                py::pyobj_handle py_param0{py::convert(param0)};
                if (!py_param0)
                {
                    throw python_exception();
                }

                py::pyobj_handle py_param1{py::convert(param1)};
                if (!py_param1)
                {
                    throw python_exception();
                }

                py::pyobj_handle args{PyTuple_Pack(2, py_param0.get(), py_param1.get())};
                if (!args)
                {
                    throw python_exception();
                }

                py::pyobj_handle return_value{PyObject_CallObject(method.get(), args.get())};
                if (!return_value)
                {
                    throw python_exception();
                }

                return py::convert_to<winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::ApplicationModel::DataTransfer::DataPackageOperation>>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto LeaveAsync(winrt::Microsoft::UI::Input::DragDrop::DragInfo const& param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

                py::pyobj_handle method{PyObject_GetAttrString(self.get(), "leave_async")};
                if (!method)
                {
                    throw python_exception();
                }

                py::pyobj_handle py_param0{py::convert(param0)};
                if (!py_param0)
                {
                    throw python_exception();
                }

                py::pyobj_handle return_value{PyObject_CallOneArg(method.get(), py_param0.get())};
                if (!return_value)
                {
                    throw python_exception();
                }

                return py::convert_to<winrt::Windows::Foundation::IAsyncAction>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto OverAsync(winrt::Microsoft::UI::Input::DragDrop::DragInfo const& param0, winrt::Microsoft::UI::Input::DragDrop::DragUIOverride const& param1)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

                py::pyobj_handle method{PyObject_GetAttrString(self.get(), "over_async")};
                if (!method)
                {
                    throw python_exception();
                }

                py::pyobj_handle py_param0{py::convert(param0)};
                if (!py_param0)
                {
                    throw python_exception();
                }

                py::pyobj_handle py_param1{py::convert(param1)};
                if (!py_param1)
                {
                    throw python_exception();
                }

                py::pyobj_handle args{PyTuple_Pack(2, py_param0.get(), py_param1.get())};
                if (!args)
                {
                    throw python_exception();
                }

                py::pyobj_handle return_value{PyObject_CallObject(method.get(), args.get())};
                if (!return_value)
                {
                    throw python_exception();
                }

                return py::convert_to<winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::ApplicationModel::DataTransfer::DataPackageOperation>>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }
    };

    static PyObject* _assign_array_IDropOperationTarget(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Microsoft::UI::Input::DragDrop::IDropOperationTarget>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_IDropOperationTarget(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Microsoft::UI::Input::DragDrop::IDropOperationTarget>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _guid_ImplementsIDropOperationTarget(PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::guid_of<winrt::Microsoft::UI::Input::DragDrop::IDropOperationTarget>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _make_ImplementsIDropOperationTarget(PyObject* /*unused*/, PyObject* args) noexcept
    {
        try
        {
            PyObject* py_obj;
            winrt::impl::inspectable_abi* runtime_class;

            if (!PyArg_ParseTuple(args, "On", &py_obj, &runtime_class))
            {
                return nullptr;
            }

            auto iface{std::make_unique<ImplementsIDropOperationTarget>(py_obj, runtime_class)};

            return PyLong_FromVoidPtr(iface.release());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef methods_ImplementsIDropOperationTarget[] = {
        { "_assign_array_", _assign_array_IDropOperationTarget, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_IDropOperationTarget), METH_O | METH_STATIC, nullptr },
        { "_guid_", reinterpret_cast<PyCFunction>(_guid_ImplementsIDropOperationTarget), METH_NOARGS | METH_STATIC, nullptr },
        { "_make_", reinterpret_cast<PyCFunction>(_make_ImplementsIDropOperationTarget), METH_VARARGS | METH_STATIC, nullptr },
        { }};

    static PyType_Slot type_slots_ImplementsIDropOperationTarget[] = {
        { Py_tp_methods, reinterpret_cast<void*>(methods_ImplementsIDropOperationTarget) },
        { }};

    static PyType_Spec type_spec_ImplementsIDropOperationTarget = {
        "winui3._winui3_microsoft_ui_input_dragdrop.IDropOperationTarget",
        0,
        0,
        Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE
        #if PY_VERSION_HEX >= 0x030A0000
        | Py_TPFLAGS_DISALLOW_INSTANTIATION
        #endif
        ,
        type_slots_ImplementsIDropOperationTarget};

    // ----- Microsoft.UI.Input.DragDrop Initialization --------------------

    PyDoc_STRVAR(module_doc, "Microsoft.UI.Input.DragDrop");

    static PyModuleDef module_def = {
        PyModuleDef_HEAD_INIT,
        "_winui3_microsoft_ui_input_dragdrop",
        module_doc,
        0,
        nullptr,
        nullptr,
        nullptr,
        nullptr,
        nullptr};
} // py::cpp::Microsoft::UI::Input::DragDrop

PyMODINIT_FUNC PyInit__winui3_microsoft_ui_input_dragdrop(void) noexcept
{
    using namespace py::cpp::Microsoft::UI::Input::DragDrop;

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

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

    if (!module)
    {
        return nullptr;
    }

    auto inspectable_meta_type = py::get_inspectable_meta_type();
    if (!inspectable_meta_type)
    {
        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 DragDropManager_Static_bases{PyTuple_Pack(1, reinterpret_cast<PyObject*>(inspectable_meta_type))};
    if (!DragDropManager_Static_bases)
    {
        return nullptr;
    }

    py::pyobj_handle type_DragDropManager_Static{PyType_FromSpecWithBases(&type_spec_DragDropManager_Static, DragDropManager_Static_bases.get())};
    if (!type_DragDropManager_Static)
    {
        return nullptr;
    }

    py::pytype_handle DragDropManager_type{py::register_python_type(module.get(), &type_spec_DragDropManager, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_DragDropManager_Static.get()))};
    if (!DragDropManager_type)
    {
        return nullptr;
    }

    py::pytype_handle DragInfo_type{py::register_python_type(module.get(), &type_spec_DragInfo, object_bases.get(), inspectable_meta_type)};
    if (!DragInfo_type)
    {
        return nullptr;
    }

    py::pytype_handle DragOperation_type{py::register_python_type(module.get(), &type_spec_DragOperation, object_bases.get(), inspectable_meta_type)};
    if (!DragOperation_type)
    {
        return nullptr;
    }

    py::pytype_handle DragUIOverride_type{py::register_python_type(module.get(), &type_spec_DragUIOverride, object_bases.get(), inspectable_meta_type)};
    if (!DragUIOverride_type)
    {
        return nullptr;
    }

    py::pytype_handle DropOperationTargetRequestedEventArgs_type{py::register_python_type(module.get(), &type_spec_DropOperationTargetRequestedEventArgs, object_bases.get(), inspectable_meta_type)};
    if (!DropOperationTargetRequestedEventArgs_type)
    {
        return nullptr;
    }

    py::pytype_handle IDropOperationTarget_type{py::register_python_type(module.get(), &type_spec_IDropOperationTarget, object_bases.get(), nullptr)};
    if (!IDropOperationTarget_type)
    {
        return nullptr;
    }

    py::pytype_handle ImplementsIDropOperationTarget_type{py::register_python_type(module.get(), &type_spec_ImplementsIDropOperationTarget, nullptr, inspectable_meta_type)};
    if (!ImplementsIDropOperationTarget_type)
    {
        return nullptr;
    }

    if (PyModule_AddType(module.get(), ImplementsIDropOperationTarget_type.get()) == -1)
    {
        return nullptr;
    }


    return module.detach();
}
