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

#include "py.Windows.Devices.Display.h"

namespace py::cpp::Windows::Devices::Display
{
    // ----- DisplayMonitor class --------------------

    static PyObject* _new_DisplayMonitor(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Devices::Display::DisplayMonitor>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::Display::DisplayMonitor>::type_name);
        return nullptr;
    }

    static void _dealloc_DisplayMonitor(py::wrapper::Windows::Devices::Display::DisplayMonitor* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* DisplayMonitor_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.Devices.Display.DisplayMonitor", 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::Devices::Display::DisplayMonitor::FromIdAsync(param0);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DisplayMonitor_FromInterfaceIdAsync(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.Devices.Display.DisplayMonitor", L"FromInterfaceIdAsync", 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::Devices::Display::DisplayMonitor::FromInterfaceIdAsync(param0);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DisplayMonitor_GetDescriptor(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"GetDescriptor", 1);
                }

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

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

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

    static PyObject* DisplayMonitor_GetDeviceSelector(PyObject* /*unused*/, 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.Devices.Display.DisplayMonitor", L"GetDeviceSelector", 0);
                }

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

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return winrt::Windows::Devices::Display::DisplayMonitor::GetDeviceSelector();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DisplayMonitor_get_BluePrimary(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"BluePrimary");
            }

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

    static PyObject* DisplayMonitor_get_ConnectionKind(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"ConnectionKind");
            }

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

    static PyObject* DisplayMonitor_get_DeviceId(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"DeviceId");
            }

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

    static PyObject* DisplayMonitor_get_DisplayAdapterDeviceId(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"DisplayAdapterDeviceId");
            }

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

    static PyObject* DisplayMonitor_get_DisplayAdapterId(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"DisplayAdapterId");
            }

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

    static PyObject* DisplayMonitor_get_DisplayAdapterTargetId(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"DisplayAdapterTargetId");
            }

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

    static PyObject* DisplayMonitor_get_DisplayName(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"DisplayName");
            }

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

    static PyObject* DisplayMonitor_get_GreenPrimary(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"GreenPrimary");
            }

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

    static PyObject* DisplayMonitor_get_MaxAverageFullFrameLuminanceInNits(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"MaxAverageFullFrameLuminanceInNits");
            }

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

    static PyObject* DisplayMonitor_get_MaxLuminanceInNits(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"MaxLuminanceInNits");
            }

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

    static PyObject* DisplayMonitor_get_MinLuminanceInNits(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"MinLuminanceInNits");
            }

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

    static PyObject* DisplayMonitor_get_NativeResolutionInRawPixels(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"NativeResolutionInRawPixels");
            }

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

    static PyObject* DisplayMonitor_get_PhysicalConnector(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"PhysicalConnector");
            }

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

    static PyObject* DisplayMonitor_get_PhysicalSizeInInches(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"PhysicalSizeInInches");
            }

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

    static PyObject* DisplayMonitor_get_RawDpiX(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"RawDpiX");
            }

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

    static PyObject* DisplayMonitor_get_RawDpiY(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"RawDpiY");
            }

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

    static PyObject* DisplayMonitor_get_RedPrimary(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"RedPrimary");
            }

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

    static PyObject* DisplayMonitor_get_UsageKind(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"UsageKind");
            }

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

    static PyObject* DisplayMonitor_get_WhitePoint(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"WhitePoint");
            }

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

    static PyObject* DisplayMonitor_get_IsDolbyVisionSupportedInHdrMode(py::wrapper::Windows::Devices::Display::DisplayMonitor* 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.Devices.Display.DisplayMonitor", L"IsDolbyVisionSupportedInHdrMode");
            }

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

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

    static PyObject* _from_DisplayMonitor(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::Devices::Display::DisplayMonitor>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_DisplayMonitor[] = {
        { "get_descriptor", reinterpret_cast<PyCFunction>(DisplayMonitor_GetDescriptor), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_DisplayMonitor, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DisplayMonitor), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_DisplayMonitor[] = {
        { "blue_primary", reinterpret_cast<getter>(DisplayMonitor_get_BluePrimary), nullptr, nullptr, nullptr },
        { "connection_kind", reinterpret_cast<getter>(DisplayMonitor_get_ConnectionKind), nullptr, nullptr, nullptr },
        { "device_id", reinterpret_cast<getter>(DisplayMonitor_get_DeviceId), nullptr, nullptr, nullptr },
        { "display_adapter_device_id", reinterpret_cast<getter>(DisplayMonitor_get_DisplayAdapterDeviceId), nullptr, nullptr, nullptr },
        { "display_adapter_id", reinterpret_cast<getter>(DisplayMonitor_get_DisplayAdapterId), nullptr, nullptr, nullptr },
        { "display_adapter_target_id", reinterpret_cast<getter>(DisplayMonitor_get_DisplayAdapterTargetId), nullptr, nullptr, nullptr },
        { "display_name", reinterpret_cast<getter>(DisplayMonitor_get_DisplayName), nullptr, nullptr, nullptr },
        { "green_primary", reinterpret_cast<getter>(DisplayMonitor_get_GreenPrimary), nullptr, nullptr, nullptr },
        { "max_average_full_frame_luminance_in_nits", reinterpret_cast<getter>(DisplayMonitor_get_MaxAverageFullFrameLuminanceInNits), nullptr, nullptr, nullptr },
        { "max_luminance_in_nits", reinterpret_cast<getter>(DisplayMonitor_get_MaxLuminanceInNits), nullptr, nullptr, nullptr },
        { "min_luminance_in_nits", reinterpret_cast<getter>(DisplayMonitor_get_MinLuminanceInNits), nullptr, nullptr, nullptr },
        { "native_resolution_in_raw_pixels", reinterpret_cast<getter>(DisplayMonitor_get_NativeResolutionInRawPixels), nullptr, nullptr, nullptr },
        { "physical_connector", reinterpret_cast<getter>(DisplayMonitor_get_PhysicalConnector), nullptr, nullptr, nullptr },
        { "physical_size_in_inches", reinterpret_cast<getter>(DisplayMonitor_get_PhysicalSizeInInches), nullptr, nullptr, nullptr },
        { "raw_dpi_x", reinterpret_cast<getter>(DisplayMonitor_get_RawDpiX), nullptr, nullptr, nullptr },
        { "raw_dpi_y", reinterpret_cast<getter>(DisplayMonitor_get_RawDpiY), nullptr, nullptr, nullptr },
        { "red_primary", reinterpret_cast<getter>(DisplayMonitor_get_RedPrimary), nullptr, nullptr, nullptr },
        { "usage_kind", reinterpret_cast<getter>(DisplayMonitor_get_UsageKind), nullptr, nullptr, nullptr },
        { "white_point", reinterpret_cast<getter>(DisplayMonitor_get_WhitePoint), nullptr, nullptr, nullptr },
        { "is_dolby_vision_supported_in_hdr_mode", reinterpret_cast<getter>(DisplayMonitor_get_IsDolbyVisionSupportedInHdrMode), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_DisplayMonitor[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_DisplayMonitor) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DisplayMonitor) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DisplayMonitor) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DisplayMonitor) },
        { }};

    static PyType_Spec type_spec_DisplayMonitor = {
        "winrt._winrt_windows_devices_display.DisplayMonitor",
        sizeof(py::wrapper::Windows::Devices::Display::DisplayMonitor),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DisplayMonitor};

    static PyGetSetDef getset_DisplayMonitor_Static[] = {
        { }};

    static PyMethodDef methods_DisplayMonitor_Static[] = {
        { "from_id_async", reinterpret_cast<PyCFunction>(DisplayMonitor_FromIdAsync), METH_VARARGS, nullptr },
        { "from_interface_id_async", reinterpret_cast<PyCFunction>(DisplayMonitor_FromInterfaceIdAsync), METH_VARARGS, nullptr },
        { "get_device_selector", reinterpret_cast<PyCFunction>(DisplayMonitor_GetDeviceSelector), METH_VARARGS, nullptr },
        { }};

    static PyType_Slot type_slots_DisplayMonitor_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_DisplayMonitor_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_DisplayMonitor_Static) },
        { }
    };

    static PyType_Spec type_spec_DisplayMonitor_Static = {
        "winrt._winrt_windows_devices_display.DisplayMonitor_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_DisplayMonitor_Static};

    // ----- Windows.Devices.Display Initialization --------------------

    PyDoc_STRVAR(module_doc, "Windows.Devices.Display");

    static PyModuleDef module_def = {
        PyModuleDef_HEAD_INIT,
        "_winrt_windows_devices_display",
        module_doc,
        0,
        nullptr,
        nullptr,
        nullptr,
        nullptr,
        nullptr};
} // py::cpp::Windows::Devices::Display

PyMODINIT_FUNC PyInit__winrt_windows_devices_display(void) noexcept
{
    using namespace py::cpp::Windows::Devices::Display;

    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 DisplayMonitor_Static_bases{PyTuple_Pack(1, reinterpret_cast<PyObject*>(inspectable_meta_type))};
    if (!DisplayMonitor_Static_bases)
    {
        return nullptr;
    }

    py::pyobj_handle type_DisplayMonitor_Static{PyType_FromSpecWithBases(&type_spec_DisplayMonitor_Static, DisplayMonitor_Static_bases.get())};
    if (!type_DisplayMonitor_Static)
    {
        return nullptr;
    }

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


    return module.detach();
}
