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

#include "py.Windows.Media.DialProtocol.h"

namespace py::cpp::Windows::Media::DialProtocol
{
    // ----- DialApp class --------------------

    static PyObject* _new_DialApp(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Media::DialProtocol::DialApp>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Media::DialProtocol::DialApp>::type_name);
        return nullptr;
    }

    static void _dealloc_DialApp(py::wrapper::Windows::Media::DialProtocol::DialApp* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* DialApp_GetAppStateAsync(py::wrapper::Windows::Media::DialProtocol::DialApp* 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"Windows.Media.DialProtocol.DialApp", L"GetAppStateAsync", 0);
                }

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

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

    static PyObject* DialApp_RequestLaunchAsync(py::wrapper::Windows::Media::DialProtocol::DialApp* 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"Windows.Media.DialProtocol.DialApp", L"RequestLaunchAsync", 1);
                }

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

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

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

    static PyObject* DialApp_StopAsync(py::wrapper::Windows::Media::DialProtocol::DialApp* 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"Windows.Media.DialProtocol.DialApp", L"StopAsync", 0);
                }

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

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

    static PyObject* DialApp_get_AppName(py::wrapper::Windows::Media::DialProtocol::DialApp* 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"Windows.Media.DialProtocol.DialApp", L"AppName");
            }

            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.AppName();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_DialApp(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::DialProtocol::DialApp>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_DialApp(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::Media::DialProtocol::DialApp>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_DialApp[] = {
        { "get_app_state_async", reinterpret_cast<PyCFunction>(DialApp_GetAppStateAsync), METH_VARARGS, nullptr },
        { "request_launch_async", reinterpret_cast<PyCFunction>(DialApp_RequestLaunchAsync), METH_VARARGS, nullptr },
        { "stop_async", reinterpret_cast<PyCFunction>(DialApp_StopAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_DialApp, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DialApp), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_DialApp[] = {
        { "app_name", reinterpret_cast<getter>(DialApp_get_AppName), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_DialApp[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_DialApp) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DialApp) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DialApp) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DialApp) },
        { }};

    static PyType_Spec type_spec_DialApp = {
        "winrt._winrt_windows_media_dialprotocol.DialApp",
        sizeof(py::wrapper::Windows::Media::DialProtocol::DialApp),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DialApp};

    // ----- DialAppStateDetails class --------------------

    static PyObject* _new_DialAppStateDetails(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Media::DialProtocol::DialAppStateDetails>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Media::DialProtocol::DialAppStateDetails>::type_name);
        return nullptr;
    }

    static void _dealloc_DialAppStateDetails(py::wrapper::Windows::Media::DialProtocol::DialAppStateDetails* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* DialAppStateDetails_get_FullXml(py::wrapper::Windows::Media::DialProtocol::DialAppStateDetails* 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"Windows.Media.DialProtocol.DialAppStateDetails", L"FullXml");
            }

            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.FullXml();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DialAppStateDetails_get_State(py::wrapper::Windows::Media::DialProtocol::DialAppStateDetails* 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"Windows.Media.DialProtocol.DialAppStateDetails", L"State");
            }

            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.State();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_DialAppStateDetails(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::DialProtocol::DialAppStateDetails>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_DialAppStateDetails(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::Media::DialProtocol::DialAppStateDetails>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_DialAppStateDetails[] = {
        { "_assign_array_", _assign_array_DialAppStateDetails, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DialAppStateDetails), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_DialAppStateDetails[] = {
        { "full_xml", reinterpret_cast<getter>(DialAppStateDetails_get_FullXml), nullptr, nullptr, nullptr },
        { "state", reinterpret_cast<getter>(DialAppStateDetails_get_State), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_DialAppStateDetails[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_DialAppStateDetails) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DialAppStateDetails) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DialAppStateDetails) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DialAppStateDetails) },
        { }};

    static PyType_Spec type_spec_DialAppStateDetails = {
        "winrt._winrt_windows_media_dialprotocol.DialAppStateDetails",
        sizeof(py::wrapper::Windows::Media::DialProtocol::DialAppStateDetails),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DialAppStateDetails};

    // ----- DialDevice class --------------------

    static PyObject* _new_DialDevice(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Media::DialProtocol::DialDevice>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Media::DialProtocol::DialDevice>::type_name);
        return nullptr;
    }

    static void _dealloc_DialDevice(py::wrapper::Windows::Media::DialProtocol::DialDevice* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* DialDevice_DeviceInfoSupportsDialAsync(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"Windows.Media.DialProtocol.DialDevice", L"DeviceInfoSupportsDialAsync", 1);
                }

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

                auto param0 = py::convert_to<winrt::Windows::Devices::Enumeration::DeviceInformation>(args, 0);

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return winrt::Windows::Media::DialProtocol::DialDevice::DeviceInfoSupportsDialAsync(param0);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DialDevice_FromIdAsync(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"Windows.Media.DialProtocol.DialDevice", L"FromIdAsync", 1);
                }

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

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

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return winrt::Windows::Media::DialProtocol::DialDevice::FromIdAsync(param0);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DialDevice_GetDeviceSelector(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"Windows.Media.DialProtocol.DialDevice", L"GetDeviceSelector", 1);
                }

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

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

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return winrt::Windows::Media::DialProtocol::DialDevice::GetDeviceSelector(param0);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DialDevice_GetDialApp(py::wrapper::Windows::Media::DialProtocol::DialDevice* 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"Windows.Media.DialProtocol.DialDevice", L"GetDialApp", 1);
                }

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

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

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

    static PyObject* DialDevice_get_Id(py::wrapper::Windows::Media::DialProtocol::DialDevice* 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"Windows.Media.DialProtocol.DialDevice", L"Id");
            }

            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.Id();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DialDevice_get_FriendlyName(py::wrapper::Windows::Media::DialProtocol::DialDevice* 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"Windows.Media.DialProtocol.DialDevice", L"FriendlyName");
            }

            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.FriendlyName();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DialDevice_get_Thumbnail(py::wrapper::Windows::Media::DialProtocol::DialDevice* 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"Windows.Media.DialProtocol.DialDevice", L"Thumbnail");
            }

            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.Thumbnail();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_DialDevice(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::DialProtocol::DialDevice>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_DialDevice(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::Media::DialProtocol::DialDevice>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_DialDevice[] = {
        { "get_dial_app", reinterpret_cast<PyCFunction>(DialDevice_GetDialApp), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_DialDevice, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DialDevice), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_DialDevice[] = {
        { "id", reinterpret_cast<getter>(DialDevice_get_Id), nullptr, nullptr, nullptr },
        { "friendly_name", reinterpret_cast<getter>(DialDevice_get_FriendlyName), nullptr, nullptr, nullptr },
        { "thumbnail", reinterpret_cast<getter>(DialDevice_get_Thumbnail), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_DialDevice[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_DialDevice) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DialDevice) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DialDevice) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DialDevice) },
        { }};

    static PyType_Spec type_spec_DialDevice = {
        "winrt._winrt_windows_media_dialprotocol.DialDevice",
        sizeof(py::wrapper::Windows::Media::DialProtocol::DialDevice),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DialDevice};

    static PyGetSetDef getset_DialDevice_Static[] = {
        { }};

    static PyMethodDef methods_DialDevice_Static[] = {
        { "device_info_supports_dial_async", reinterpret_cast<PyCFunction>(DialDevice_DeviceInfoSupportsDialAsync), METH_VARARGS, nullptr },
        { "from_id_async", reinterpret_cast<PyCFunction>(DialDevice_FromIdAsync), METH_VARARGS, nullptr },
        { "get_device_selector", reinterpret_cast<PyCFunction>(DialDevice_GetDeviceSelector), METH_VARARGS, nullptr },
        { }};

    static PyType_Slot type_slots_DialDevice_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_DialDevice_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_DialDevice_Static) },
        { }
    };

    static PyType_Spec type_spec_DialDevice_Static = {
        "winrt._winrt_windows_media_dialprotocol.DialDevice_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_DialDevice_Static};

    // ----- DialDevicePicker class --------------------

    static PyObject* _new_DialDevicePicker(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::Windows::Media::DialProtocol::DialDevicePicker 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_DialDevicePicker(py::wrapper::Windows::Media::DialProtocol::DialDevicePicker* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* DialDevicePicker_Hide(py::wrapper::Windows::Media::DialProtocol::DialDevicePicker* 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"Windows.Media.DialProtocol.DialDevicePicker", L"Hide", 0);
                }

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

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

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

    static PyObject* DialDevicePicker_PickSingleDialDeviceAsync(py::wrapper::Windows::Media::DialProtocol::DialDevicePicker* 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"Windows.Media.DialProtocol.DialDevicePicker", L"PickSingleDialDeviceAsync", 1);
                }

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

                auto param0 = py::convert_to<winrt::Windows::Foundation::Rect>(args, 0);

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

    static PyObject* DialDevicePicker_PickSingleDialDeviceAsyncWithPlacement(py::wrapper::Windows::Media::DialProtocol::DialDevicePicker* 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"Windows.Media.DialProtocol.DialDevicePicker", L"PickSingleDialDeviceAsync", 2);
                }

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

                auto param0 = py::convert_to<winrt::Windows::Foundation::Rect>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::UI::Popups::Placement>(args, 1);

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

    static PyObject* DialDevicePicker_SetDisplayStatus(py::wrapper::Windows::Media::DialProtocol::DialDevicePicker* 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"Windows.Media.DialProtocol.DialDevicePicker", L"SetDisplayStatus", 2);
                }

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

                auto param0 = py::convert_to<winrt::Windows::Media::DialProtocol::DialDevice>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Media::DialProtocol::DialDeviceDisplayStatus>(args, 1);

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

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

    static PyObject* DialDevicePicker_Show(py::wrapper::Windows::Media::DialProtocol::DialDevicePicker* 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"Windows.Media.DialProtocol.DialDevicePicker", L"Show", 1);
                }

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

                auto param0 = py::convert_to<winrt::Windows::Foundation::Rect>(args, 0);

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

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

    static PyObject* DialDevicePicker_ShowWithPlacement(py::wrapper::Windows::Media::DialProtocol::DialDevicePicker* 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"Windows.Media.DialProtocol.DialDevicePicker", L"Show", 2);
                }

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

                auto param0 = py::convert_to<winrt::Windows::Foundation::Rect>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::UI::Popups::Placement>(args, 1);

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

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

    static PyObject* DialDevicePicker_get_Appearance(py::wrapper::Windows::Media::DialProtocol::DialDevicePicker* 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"Windows.Media.DialProtocol.DialDevicePicker", L"Appearance");
            }

            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.Appearance();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DialDevicePicker_get_Filter(py::wrapper::Windows::Media::DialProtocol::DialDevicePicker* 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"Windows.Media.DialProtocol.DialDevicePicker", L"Filter");
            }

            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.Filter();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DialDevicePicker_add_DialDevicePickerDismissed(py::wrapper::Windows::Media::DialProtocol::DialDevicePicker* 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"Windows.Media.DialProtocol.DialDevicePicker", L"DialDevicePickerDismissed");
            }

            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::Windows::Media::DialProtocol::DialDevicePicker, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* DialDevicePicker_remove_DialDevicePickerDismissed(py::wrapper::Windows::Media::DialProtocol::DialDevicePicker* 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"Windows.Media.DialProtocol.DialDevicePicker", L"DialDevicePickerDismissed");
            }

            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.DialDevicePickerDismissed(param0);
            }

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

    static PyObject* DialDevicePicker_add_DialDeviceSelected(py::wrapper::Windows::Media::DialProtocol::DialDevicePicker* 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"Windows.Media.DialProtocol.DialDevicePicker", L"DialDeviceSelected");
            }

            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::Windows::Media::DialProtocol::DialDevicePicker, winrt::Windows::Media::DialProtocol::DialDeviceSelectedEventArgs>>(arg);

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

    static PyObject* DialDevicePicker_remove_DialDeviceSelected(py::wrapper::Windows::Media::DialProtocol::DialDevicePicker* 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"Windows.Media.DialProtocol.DialDevicePicker", L"DialDeviceSelected");
            }

            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.DialDeviceSelected(param0);
            }

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

    static PyObject* DialDevicePicker_add_DisconnectButtonClicked(py::wrapper::Windows::Media::DialProtocol::DialDevicePicker* 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"Windows.Media.DialProtocol.DialDevicePicker", L"DisconnectButtonClicked");
            }

            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::Windows::Media::DialProtocol::DialDevicePicker, winrt::Windows::Media::DialProtocol::DialDisconnectButtonClickedEventArgs>>(arg);

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

    static PyObject* DialDevicePicker_remove_DisconnectButtonClicked(py::wrapper::Windows::Media::DialProtocol::DialDevicePicker* 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"Windows.Media.DialProtocol.DialDevicePicker", L"DisconnectButtonClicked");
            }

            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.DisconnectButtonClicked(param0);
            }

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

    static PyObject* _assign_array_DialDevicePicker(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::DialProtocol::DialDevicePicker>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_DialDevicePicker(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::Media::DialProtocol::DialDevicePicker>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_DialDevicePicker[] = {
        { "hide", reinterpret_cast<PyCFunction>(DialDevicePicker_Hide), METH_VARARGS, nullptr },
        { "pick_single_dial_device_async", reinterpret_cast<PyCFunction>(DialDevicePicker_PickSingleDialDeviceAsync), METH_VARARGS, nullptr },
        { "pick_single_dial_device_async_with_placement", reinterpret_cast<PyCFunction>(DialDevicePicker_PickSingleDialDeviceAsyncWithPlacement), METH_VARARGS, nullptr },
        { "set_display_status", reinterpret_cast<PyCFunction>(DialDevicePicker_SetDisplayStatus), METH_VARARGS, nullptr },
        { "show", reinterpret_cast<PyCFunction>(DialDevicePicker_Show), METH_VARARGS, nullptr },
        { "show_with_placement", reinterpret_cast<PyCFunction>(DialDevicePicker_ShowWithPlacement), METH_VARARGS, nullptr },
        { "add_dial_device_picker_dismissed", reinterpret_cast<PyCFunction>(DialDevicePicker_add_DialDevicePickerDismissed), METH_O, nullptr },
        { "remove_dial_device_picker_dismissed", reinterpret_cast<PyCFunction>(DialDevicePicker_remove_DialDevicePickerDismissed), METH_O, nullptr },
        { "add_dial_device_selected", reinterpret_cast<PyCFunction>(DialDevicePicker_add_DialDeviceSelected), METH_O, nullptr },
        { "remove_dial_device_selected", reinterpret_cast<PyCFunction>(DialDevicePicker_remove_DialDeviceSelected), METH_O, nullptr },
        { "add_disconnect_button_clicked", reinterpret_cast<PyCFunction>(DialDevicePicker_add_DisconnectButtonClicked), METH_O, nullptr },
        { "remove_disconnect_button_clicked", reinterpret_cast<PyCFunction>(DialDevicePicker_remove_DisconnectButtonClicked), METH_O, nullptr },
        { "_assign_array_", _assign_array_DialDevicePicker, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DialDevicePicker), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_DialDevicePicker[] = {
        { "appearance", reinterpret_cast<getter>(DialDevicePicker_get_Appearance), nullptr, nullptr, nullptr },
        { "filter", reinterpret_cast<getter>(DialDevicePicker_get_Filter), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_DialDevicePicker[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_DialDevicePicker) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DialDevicePicker) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DialDevicePicker) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DialDevicePicker) },
        { }};

    static PyType_Spec type_spec_DialDevicePicker = {
        "winrt._winrt_windows_media_dialprotocol.DialDevicePicker",
        sizeof(py::wrapper::Windows::Media::DialProtocol::DialDevicePicker),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DialDevicePicker};

    // ----- DialDevicePickerFilter class --------------------

    static PyObject* _new_DialDevicePickerFilter(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Media::DialProtocol::DialDevicePickerFilter>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Media::DialProtocol::DialDevicePickerFilter>::type_name);
        return nullptr;
    }

    static void _dealloc_DialDevicePickerFilter(py::wrapper::Windows::Media::DialProtocol::DialDevicePickerFilter* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* DialDevicePickerFilter_get_SupportedAppNames(py::wrapper::Windows::Media::DialProtocol::DialDevicePickerFilter* 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"Windows.Media.DialProtocol.DialDevicePickerFilter", L"SupportedAppNames");
            }

            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.SupportedAppNames();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_DialDevicePickerFilter(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::DialProtocol::DialDevicePickerFilter>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_DialDevicePickerFilter(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::Media::DialProtocol::DialDevicePickerFilter>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_DialDevicePickerFilter[] = {
        { "_assign_array_", _assign_array_DialDevicePickerFilter, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DialDevicePickerFilter), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_DialDevicePickerFilter[] = {
        { "supported_app_names", reinterpret_cast<getter>(DialDevicePickerFilter_get_SupportedAppNames), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_DialDevicePickerFilter[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_DialDevicePickerFilter) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DialDevicePickerFilter) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DialDevicePickerFilter) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DialDevicePickerFilter) },
        { }};

    static PyType_Spec type_spec_DialDevicePickerFilter = {
        "winrt._winrt_windows_media_dialprotocol.DialDevicePickerFilter",
        sizeof(py::wrapper::Windows::Media::DialProtocol::DialDevicePickerFilter),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DialDevicePickerFilter};

    // ----- DialDeviceSelectedEventArgs class --------------------

    static PyObject* _new_DialDeviceSelectedEventArgs(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Media::DialProtocol::DialDeviceSelectedEventArgs>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Media::DialProtocol::DialDeviceSelectedEventArgs>::type_name);
        return nullptr;
    }

    static void _dealloc_DialDeviceSelectedEventArgs(py::wrapper::Windows::Media::DialProtocol::DialDeviceSelectedEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* DialDeviceSelectedEventArgs_get_SelectedDialDevice(py::wrapper::Windows::Media::DialProtocol::DialDeviceSelectedEventArgs* 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"Windows.Media.DialProtocol.DialDeviceSelectedEventArgs", L"SelectedDialDevice");
            }

            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.SelectedDialDevice();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_DialDeviceSelectedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::DialProtocol::DialDeviceSelectedEventArgs>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_DialDeviceSelectedEventArgs(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::Media::DialProtocol::DialDeviceSelectedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_DialDeviceSelectedEventArgs[] = {
        { "_assign_array_", _assign_array_DialDeviceSelectedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DialDeviceSelectedEventArgs), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_DialDeviceSelectedEventArgs[] = {
        { "selected_dial_device", reinterpret_cast<getter>(DialDeviceSelectedEventArgs_get_SelectedDialDevice), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_DialDeviceSelectedEventArgs[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_DialDeviceSelectedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DialDeviceSelectedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DialDeviceSelectedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DialDeviceSelectedEventArgs) },
        { }};

    static PyType_Spec type_spec_DialDeviceSelectedEventArgs = {
        "winrt._winrt_windows_media_dialprotocol.DialDeviceSelectedEventArgs",
        sizeof(py::wrapper::Windows::Media::DialProtocol::DialDeviceSelectedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DialDeviceSelectedEventArgs};

    // ----- DialDisconnectButtonClickedEventArgs class --------------------

    static PyObject* _new_DialDisconnectButtonClickedEventArgs(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Media::DialProtocol::DialDisconnectButtonClickedEventArgs>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Media::DialProtocol::DialDisconnectButtonClickedEventArgs>::type_name);
        return nullptr;
    }

    static void _dealloc_DialDisconnectButtonClickedEventArgs(py::wrapper::Windows::Media::DialProtocol::DialDisconnectButtonClickedEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* DialDisconnectButtonClickedEventArgs_get_Device(py::wrapper::Windows::Media::DialProtocol::DialDisconnectButtonClickedEventArgs* 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"Windows.Media.DialProtocol.DialDisconnectButtonClickedEventArgs", L"Device");
            }

            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.Device();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_DialDisconnectButtonClickedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::DialProtocol::DialDisconnectButtonClickedEventArgs>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_DialDisconnectButtonClickedEventArgs(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::Media::DialProtocol::DialDisconnectButtonClickedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_DialDisconnectButtonClickedEventArgs[] = {
        { "_assign_array_", _assign_array_DialDisconnectButtonClickedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DialDisconnectButtonClickedEventArgs), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_DialDisconnectButtonClickedEventArgs[] = {
        { "device", reinterpret_cast<getter>(DialDisconnectButtonClickedEventArgs_get_Device), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_DialDisconnectButtonClickedEventArgs[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_DialDisconnectButtonClickedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DialDisconnectButtonClickedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DialDisconnectButtonClickedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DialDisconnectButtonClickedEventArgs) },
        { }};

    static PyType_Spec type_spec_DialDisconnectButtonClickedEventArgs = {
        "winrt._winrt_windows_media_dialprotocol.DialDisconnectButtonClickedEventArgs",
        sizeof(py::wrapper::Windows::Media::DialProtocol::DialDisconnectButtonClickedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DialDisconnectButtonClickedEventArgs};

    // ----- DialReceiverApp class --------------------

    static PyObject* _new_DialReceiverApp(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Media::DialProtocol::DialReceiverApp>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Media::DialProtocol::DialReceiverApp>::type_name);
        return nullptr;
    }

    static void _dealloc_DialReceiverApp(py::wrapper::Windows::Media::DialProtocol::DialReceiverApp* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* DialReceiverApp_GetAdditionalDataAsync(py::wrapper::Windows::Media::DialProtocol::DialReceiverApp* 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"Windows.Media.DialProtocol.DialReceiverApp", L"GetAdditionalDataAsync", 0);
                }

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

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

    static PyObject* DialReceiverApp_GetUniqueDeviceNameAsync(py::wrapper::Windows::Media::DialProtocol::DialReceiverApp* 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"Windows.Media.DialProtocol.DialReceiverApp", L"GetUniqueDeviceNameAsync", 0);
                }

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

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

    static PyObject* DialReceiverApp_SetAdditionalDataAsync(py::wrapper::Windows::Media::DialProtocol::DialReceiverApp* 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"Windows.Media.DialProtocol.DialReceiverApp", L"SetAdditionalDataAsync", 1);
                }

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

                auto param0 = py::convert_to<winrt::Windows::Foundation::Collections::IIterable<winrt::Windows::Foundation::Collections::IKeyValuePair<winrt::hstring, winrt::hstring>>>(args, 0);

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

    static PyObject* DialReceiverApp_get_Current(PyObject* /*unused*/, 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"Windows.Media.DialProtocol.DialReceiverApp", L"Current");
            }

            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 winrt::Windows::Media::DialProtocol::DialReceiverApp::Current();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_DialReceiverApp(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::DialProtocol::DialReceiverApp>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_DialReceiverApp(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::Media::DialProtocol::DialReceiverApp>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_DialReceiverApp[] = {
        { "get_additional_data_async", reinterpret_cast<PyCFunction>(DialReceiverApp_GetAdditionalDataAsync), METH_VARARGS, nullptr },
        { "get_unique_device_name_async", reinterpret_cast<PyCFunction>(DialReceiverApp_GetUniqueDeviceNameAsync), METH_VARARGS, nullptr },
        { "set_additional_data_async", reinterpret_cast<PyCFunction>(DialReceiverApp_SetAdditionalDataAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_DialReceiverApp, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DialReceiverApp), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_DialReceiverApp[] = {
        { }};

    static PyType_Slot _type_slots_DialReceiverApp[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_DialReceiverApp) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DialReceiverApp) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DialReceiverApp) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DialReceiverApp) },
        { }};

    static PyType_Spec type_spec_DialReceiverApp = {
        "winrt._winrt_windows_media_dialprotocol.DialReceiverApp",
        sizeof(py::wrapper::Windows::Media::DialProtocol::DialReceiverApp),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DialReceiverApp};

    static PyGetSetDef getset_DialReceiverApp_Static[] = {
        { "current", reinterpret_cast<getter>(DialReceiverApp_get_Current), nullptr, nullptr, nullptr },
        { }};

    static PyMethodDef methods_DialReceiverApp_Static[] = {
        { }};

    static PyType_Slot type_slots_DialReceiverApp_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_DialReceiverApp_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_DialReceiverApp_Static) },
        { }
    };

    static PyType_Spec type_spec_DialReceiverApp_Static = {
        "winrt._winrt_windows_media_dialprotocol.DialReceiverApp_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_DialReceiverApp_Static};

    // ----- Windows.Media.DialProtocol Initialization --------------------

    PyDoc_STRVAR(module_doc, "Windows.Media.DialProtocol");

    static PyModuleDef module_def = {
        PyModuleDef_HEAD_INIT,
        "_winrt_windows_media_dialprotocol",
        module_doc,
        0,
        nullptr,
        nullptr,
        nullptr,
        nullptr,
        nullptr};
} // py::cpp::Windows::Media::DialProtocol

PyMODINIT_FUNC PyInit__winrt_windows_media_dialprotocol(void) noexcept
{
    using namespace py::cpp::Windows::Media::DialProtocol;

    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::pytype_handle DialApp_type{py::register_python_type(module.get(), &type_spec_DialApp, object_bases.get(), inspectable_meta_type)};
    if (!DialApp_type)
    {
        return nullptr;
    }

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

    py::pyobj_handle DialDevice_Static_bases{PyTuple_Pack(1, reinterpret_cast<PyObject*>(inspectable_meta_type))};
    if (!DialDevice_Static_bases)
    {
        return nullptr;
    }

    py::pyobj_handle type_DialDevice_Static{PyType_FromSpecWithBases(&type_spec_DialDevice_Static, DialDevice_Static_bases.get())};
    if (!type_DialDevice_Static)
    {
        return nullptr;
    }

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

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

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

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

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

    py::pyobj_handle DialReceiverApp_Static_bases{PyTuple_Pack(1, reinterpret_cast<PyObject*>(inspectable_meta_type))};
    if (!DialReceiverApp_Static_bases)
    {
        return nullptr;
    }

    py::pyobj_handle type_DialReceiverApp_Static{PyType_FromSpecWithBases(&type_spec_DialReceiverApp_Static, DialReceiverApp_Static_bases.get())};
    if (!type_DialReceiverApp_Static)
    {
        return nullptr;
    }

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


    return module.detach();
}
