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

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


namespace py::cpp::Windows::Graphics::Display
{
    // ----- AdvancedColorInfo class --------------------

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

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

    static PyObject* AdvancedColorInfo_IsAdvancedColorKindAvailable(py::wrapper::Windows::Graphics::Display::AdvancedColorInfo* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.AdvancedColorInfo", L"IsAdvancedColorKindAvailable", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Graphics::Display::AdvancedColorKind>(args, 0);

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

    static PyObject* AdvancedColorInfo_IsHdrMetadataFormatCurrentlySupported(py::wrapper::Windows::Graphics::Display::AdvancedColorInfo* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.AdvancedColorInfo", L"IsHdrMetadataFormatCurrentlySupported", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Graphics::Display::HdrMetadataFormat>(args, 0);

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

    static PyObject* AdvancedColorInfo_get_BluePrimary(py::wrapper::Windows::Graphics::Display::AdvancedColorInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.AdvancedColorInfo", L"BluePrimary"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AdvancedColorInfo_get_CurrentAdvancedColorKind(py::wrapper::Windows::Graphics::Display::AdvancedColorInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.AdvancedColorInfo", L"CurrentAdvancedColorKind"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AdvancedColorInfo_get_GreenPrimary(py::wrapper::Windows::Graphics::Display::AdvancedColorInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.AdvancedColorInfo", L"GreenPrimary"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AdvancedColorInfo_get_MaxAverageFullFrameLuminanceInNits(py::wrapper::Windows::Graphics::Display::AdvancedColorInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.AdvancedColorInfo", L"MaxAverageFullFrameLuminanceInNits"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AdvancedColorInfo_get_MaxLuminanceInNits(py::wrapper::Windows::Graphics::Display::AdvancedColorInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.AdvancedColorInfo", L"MaxLuminanceInNits"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AdvancedColorInfo_get_MinLuminanceInNits(py::wrapper::Windows::Graphics::Display::AdvancedColorInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.AdvancedColorInfo", L"MinLuminanceInNits"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AdvancedColorInfo_get_RedPrimary(py::wrapper::Windows::Graphics::Display::AdvancedColorInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.AdvancedColorInfo", L"RedPrimary"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AdvancedColorInfo_get_SdrWhiteLevelInNits(py::wrapper::Windows::Graphics::Display::AdvancedColorInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.AdvancedColorInfo", L"SdrWhiteLevelInNits"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AdvancedColorInfo_get_WhitePoint(py::wrapper::Windows::Graphics::Display::AdvancedColorInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.AdvancedColorInfo", L"WhitePoint"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

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

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

    static PyMethodDef _methods_AdvancedColorInfo[] = {
        { "is_advanced_color_kind_available", reinterpret_cast<PyCFunction>(AdvancedColorInfo_IsAdvancedColorKindAvailable), METH_VARARGS, nullptr },
        { "is_hdr_metadata_format_currently_supported", reinterpret_cast<PyCFunction>(AdvancedColorInfo_IsHdrMetadataFormatCurrentlySupported), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_AdvancedColorInfo, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_AdvancedColorInfo), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_AdvancedColorInfo[] = {
        { "blue_primary", reinterpret_cast<getter>(AdvancedColorInfo_get_BluePrimary), nullptr, nullptr, nullptr },
        { "current_advanced_color_kind", reinterpret_cast<getter>(AdvancedColorInfo_get_CurrentAdvancedColorKind), nullptr, nullptr, nullptr },
        { "green_primary", reinterpret_cast<getter>(AdvancedColorInfo_get_GreenPrimary), nullptr, nullptr, nullptr },
        { "max_average_full_frame_luminance_in_nits", reinterpret_cast<getter>(AdvancedColorInfo_get_MaxAverageFullFrameLuminanceInNits), nullptr, nullptr, nullptr },
        { "max_luminance_in_nits", reinterpret_cast<getter>(AdvancedColorInfo_get_MaxLuminanceInNits), nullptr, nullptr, nullptr },
        { "min_luminance_in_nits", reinterpret_cast<getter>(AdvancedColorInfo_get_MinLuminanceInNits), nullptr, nullptr, nullptr },
        { "red_primary", reinterpret_cast<getter>(AdvancedColorInfo_get_RedPrimary), nullptr, nullptr, nullptr },
        { "sdr_white_level_in_nits", reinterpret_cast<getter>(AdvancedColorInfo_get_SdrWhiteLevelInNits), nullptr, nullptr, nullptr },
        { "white_point", reinterpret_cast<getter>(AdvancedColorInfo_get_WhitePoint), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_AdvancedColorInfo[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_AdvancedColorInfo) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_AdvancedColorInfo) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_AdvancedColorInfo) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_AdvancedColorInfo) },
        { },
    };

    static PyType_Spec type_spec_AdvancedColorInfo =
    {
        "winrt._winrt_windows_graphics_display.AdvancedColorInfo",
        sizeof(py::wrapper::Windows::Graphics::Display::AdvancedColorInfo),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_AdvancedColorInfo
    };

    // ----- BrightnessOverride class --------------------

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

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

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

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.BrightnessOverride", L"GetDefaultForSystem", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Graphics::Display::BrightnessOverride::GetDefaultForSystem());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.BrightnessOverride", L"GetForCurrentView", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Graphics::Display::BrightnessOverride::GetForCurrentView());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* BrightnessOverride_GetLevelForScenario(py::wrapper::Windows::Graphics::Display::BrightnessOverride* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.BrightnessOverride", L"GetLevelForScenario", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Graphics::Display::DisplayBrightnessScenario>(args, 0);

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

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

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.BrightnessOverride", L"SaveForSystemAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Graphics::Display::BrightnessOverride>(args, 0);

                return py::convert(winrt::Windows::Graphics::Display::BrightnessOverride::SaveForSystemAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* BrightnessOverride_SetBrightnessLevel(py::wrapper::Windows::Graphics::Display::BrightnessOverride* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.BrightnessOverride", L"SetBrightnessLevel", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<double>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Graphics::Display::DisplayBrightnessOverrideOptions>(args, 1);

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

    static PyObject* BrightnessOverride_SetBrightnessScenario(py::wrapper::Windows::Graphics::Display::BrightnessOverride* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.BrightnessOverride", L"SetBrightnessScenario", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Graphics::Display::DisplayBrightnessScenario>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Graphics::Display::DisplayBrightnessOverrideOptions>(args, 1);

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

    static PyObject* BrightnessOverride_StartOverride(py::wrapper::Windows::Graphics::Display::BrightnessOverride* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.BrightnessOverride", L"StartOverride", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* BrightnessOverride_StopOverride(py::wrapper::Windows::Graphics::Display::BrightnessOverride* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.BrightnessOverride", L"StopOverride", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* BrightnessOverride_get_BrightnessLevel(py::wrapper::Windows::Graphics::Display::BrightnessOverride* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.BrightnessOverride", L"BrightnessLevel"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* BrightnessOverride_get_IsOverrideActive(py::wrapper::Windows::Graphics::Display::BrightnessOverride* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.BrightnessOverride", L"IsOverrideActive"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* BrightnessOverride_get_IsSupported(py::wrapper::Windows::Graphics::Display::BrightnessOverride* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.BrightnessOverride", L"IsSupported"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* BrightnessOverride_add_BrightnessLevelChanged(py::wrapper::Windows::Graphics::Display::BrightnessOverride* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.BrightnessOverride", L"BrightnessLevelChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Graphics::Display::BrightnessOverride, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* BrightnessOverride_remove_BrightnessLevelChanged(py::wrapper::Windows::Graphics::Display::BrightnessOverride* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.BrightnessOverride", L"BrightnessLevelChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            self->obj.BrightnessLevelChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* BrightnessOverride_add_IsOverrideActiveChanged(py::wrapper::Windows::Graphics::Display::BrightnessOverride* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.BrightnessOverride", L"IsOverrideActiveChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Graphics::Display::BrightnessOverride, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* BrightnessOverride_remove_IsOverrideActiveChanged(py::wrapper::Windows::Graphics::Display::BrightnessOverride* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.BrightnessOverride", L"IsOverrideActiveChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            self->obj.IsOverrideActiveChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* BrightnessOverride_add_IsSupportedChanged(py::wrapper::Windows::Graphics::Display::BrightnessOverride* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.BrightnessOverride", L"IsSupportedChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Graphics::Display::BrightnessOverride, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* BrightnessOverride_remove_IsSupportedChanged(py::wrapper::Windows::Graphics::Display::BrightnessOverride* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.BrightnessOverride", L"IsSupportedChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            self->obj.IsSupportedChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

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

    static PyMethodDef _methods_BrightnessOverride[] = {
        { "get_level_for_scenario", reinterpret_cast<PyCFunction>(BrightnessOverride_GetLevelForScenario), METH_VARARGS, nullptr },
        { "set_brightness_level", reinterpret_cast<PyCFunction>(BrightnessOverride_SetBrightnessLevel), METH_VARARGS, nullptr },
        { "set_brightness_scenario", reinterpret_cast<PyCFunction>(BrightnessOverride_SetBrightnessScenario), METH_VARARGS, nullptr },
        { "start_override", reinterpret_cast<PyCFunction>(BrightnessOverride_StartOverride), METH_VARARGS, nullptr },
        { "stop_override", reinterpret_cast<PyCFunction>(BrightnessOverride_StopOverride), METH_VARARGS, nullptr },
        { "add_brightness_level_changed", reinterpret_cast<PyCFunction>(BrightnessOverride_add_BrightnessLevelChanged), METH_O, nullptr },
        { "remove_brightness_level_changed", reinterpret_cast<PyCFunction>(BrightnessOverride_remove_BrightnessLevelChanged), METH_O, nullptr },
        { "add_is_override_active_changed", reinterpret_cast<PyCFunction>(BrightnessOverride_add_IsOverrideActiveChanged), METH_O, nullptr },
        { "remove_is_override_active_changed", reinterpret_cast<PyCFunction>(BrightnessOverride_remove_IsOverrideActiveChanged), METH_O, nullptr },
        { "add_is_supported_changed", reinterpret_cast<PyCFunction>(BrightnessOverride_add_IsSupportedChanged), METH_O, nullptr },
        { "remove_is_supported_changed", reinterpret_cast<PyCFunction>(BrightnessOverride_remove_IsSupportedChanged), METH_O, nullptr },
        { "_assign_array_", _assign_array_BrightnessOverride, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_BrightnessOverride), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_BrightnessOverride[] = {
        { "brightness_level", reinterpret_cast<getter>(BrightnessOverride_get_BrightnessLevel), nullptr, nullptr, nullptr },
        { "is_override_active", reinterpret_cast<getter>(BrightnessOverride_get_IsOverrideActive), nullptr, nullptr, nullptr },
        { "is_supported", reinterpret_cast<getter>(BrightnessOverride_get_IsSupported), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_BrightnessOverride[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_BrightnessOverride) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_BrightnessOverride) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_BrightnessOverride) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_BrightnessOverride) },
        { },
    };

    static PyType_Spec type_spec_BrightnessOverride =
    {
        "winrt._winrt_windows_graphics_display.BrightnessOverride",
        sizeof(py::wrapper::Windows::Graphics::Display::BrightnessOverride),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_BrightnessOverride
    };

    static PyGetSetDef getset_BrightnessOverride_Static[] = {
        { }
    };

    static PyMethodDef methods_BrightnessOverride_Static[] = {
        { "get_default_for_system", reinterpret_cast<PyCFunction>(BrightnessOverride_GetDefaultForSystem), METH_VARARGS, nullptr },
        { "get_for_current_view", reinterpret_cast<PyCFunction>(BrightnessOverride_GetForCurrentView), METH_VARARGS, nullptr },
        { "save_for_system_async", reinterpret_cast<PyCFunction>(BrightnessOverride_SaveForSystemAsync), METH_VARARGS, nullptr },
        { }
    };

    static PyType_Slot type_slots_BrightnessOverride_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_BrightnessOverride_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_BrightnessOverride_Static) },
        { }
    };

    static PyType_Spec type_spec_BrightnessOverride_Static =
    {
        "winrt._winrt_windows_graphics_display.BrightnessOverride_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_BrightnessOverride_Static
    };

    // ----- BrightnessOverrideSettings class --------------------

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

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

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

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.BrightnessOverrideSettings", L"CreateFromDisplayBrightnessOverrideScenario", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Graphics::Display::DisplayBrightnessOverrideScenario>(args, 0);

                return py::convert(winrt::Windows::Graphics::Display::BrightnessOverrideSettings::CreateFromDisplayBrightnessOverrideScenario(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.BrightnessOverrideSettings", L"CreateFromLevel", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<double>(args, 0);

                return py::convert(winrt::Windows::Graphics::Display::BrightnessOverrideSettings::CreateFromLevel(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.BrightnessOverrideSettings", L"CreateFromNits", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<float>(args, 0);

                return py::convert(winrt::Windows::Graphics::Display::BrightnessOverrideSettings::CreateFromNits(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* BrightnessOverrideSettings_get_DesiredLevel(py::wrapper::Windows::Graphics::Display::BrightnessOverrideSettings* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.BrightnessOverrideSettings", L"DesiredLevel"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* BrightnessOverrideSettings_get_DesiredNits(py::wrapper::Windows::Graphics::Display::BrightnessOverrideSettings* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.BrightnessOverrideSettings", L"DesiredNits"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

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

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

    static PyMethodDef _methods_BrightnessOverrideSettings[] = {
        { "_assign_array_", _assign_array_BrightnessOverrideSettings, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_BrightnessOverrideSettings), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_BrightnessOverrideSettings[] = {
        { "desired_level", reinterpret_cast<getter>(BrightnessOverrideSettings_get_DesiredLevel), nullptr, nullptr, nullptr },
        { "desired_nits", reinterpret_cast<getter>(BrightnessOverrideSettings_get_DesiredNits), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_BrightnessOverrideSettings[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_BrightnessOverrideSettings) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_BrightnessOverrideSettings) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_BrightnessOverrideSettings) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_BrightnessOverrideSettings) },
        { },
    };

    static PyType_Spec type_spec_BrightnessOverrideSettings =
    {
        "winrt._winrt_windows_graphics_display.BrightnessOverrideSettings",
        sizeof(py::wrapper::Windows::Graphics::Display::BrightnessOverrideSettings),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_BrightnessOverrideSettings
    };

    static PyGetSetDef getset_BrightnessOverrideSettings_Static[] = {
        { }
    };

    static PyMethodDef methods_BrightnessOverrideSettings_Static[] = {
        { "create_from_display_brightness_override_scenario", reinterpret_cast<PyCFunction>(BrightnessOverrideSettings_CreateFromDisplayBrightnessOverrideScenario), METH_VARARGS, nullptr },
        { "create_from_level", reinterpret_cast<PyCFunction>(BrightnessOverrideSettings_CreateFromLevel), METH_VARARGS, nullptr },
        { "create_from_nits", reinterpret_cast<PyCFunction>(BrightnessOverrideSettings_CreateFromNits), METH_VARARGS, nullptr },
        { }
    };

    static PyType_Slot type_slots_BrightnessOverrideSettings_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_BrightnessOverrideSettings_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_BrightnessOverrideSettings_Static) },
        { }
    };

    static PyType_Spec type_spec_BrightnessOverrideSettings_Static =
    {
        "winrt._winrt_windows_graphics_display.BrightnessOverrideSettings_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_BrightnessOverrideSettings_Static
    };

    // ----- ColorOverrideSettings class --------------------

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

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

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

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.ColorOverrideSettings", L"CreateFromDisplayColorOverrideScenario", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Graphics::Display::DisplayColorOverrideScenario>(args, 0);

                return py::convert(winrt::Windows::Graphics::Display::ColorOverrideSettings::CreateFromDisplayColorOverrideScenario(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* ColorOverrideSettings_get_DesiredDisplayColorOverrideScenario(py::wrapper::Windows::Graphics::Display::ColorOverrideSettings* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.ColorOverrideSettings", L"DesiredDisplayColorOverrideScenario"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

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

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

    static PyMethodDef _methods_ColorOverrideSettings[] = {
        { "_assign_array_", _assign_array_ColorOverrideSettings, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_ColorOverrideSettings), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_ColorOverrideSettings[] = {
        { "desired_display_color_override_scenario", reinterpret_cast<getter>(ColorOverrideSettings_get_DesiredDisplayColorOverrideScenario), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_ColorOverrideSettings[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_ColorOverrideSettings) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_ColorOverrideSettings) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_ColorOverrideSettings) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_ColorOverrideSettings) },
        { },
    };

    static PyType_Spec type_spec_ColorOverrideSettings =
    {
        "winrt._winrt_windows_graphics_display.ColorOverrideSettings",
        sizeof(py::wrapper::Windows::Graphics::Display::ColorOverrideSettings),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_ColorOverrideSettings
    };

    static PyGetSetDef getset_ColorOverrideSettings_Static[] = {
        { }
    };

    static PyMethodDef methods_ColorOverrideSettings_Static[] = {
        { "create_from_display_color_override_scenario", reinterpret_cast<PyCFunction>(ColorOverrideSettings_CreateFromDisplayColorOverrideScenario), METH_VARARGS, nullptr },
        { }
    };

    static PyType_Slot type_slots_ColorOverrideSettings_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_ColorOverrideSettings_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_ColorOverrideSettings_Static) },
        { }
    };

    static PyType_Spec type_spec_ColorOverrideSettings_Static =
    {
        "winrt._winrt_windows_graphics_display.ColorOverrideSettings_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_ColorOverrideSettings_Static
    };

    // ----- DisplayEnhancementOverride class --------------------

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

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

    static PyObject* DisplayEnhancementOverride_GetCurrentDisplayEnhancementOverrideCapabilities(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverride* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.DisplayEnhancementOverride", L"GetCurrentDisplayEnhancementOverrideCapabilities", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

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

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.DisplayEnhancementOverride", L"GetForCurrentView", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Graphics::Display::DisplayEnhancementOverride::GetForCurrentView());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DisplayEnhancementOverride_RequestOverride(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverride* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.DisplayEnhancementOverride", L"RequestOverride", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* DisplayEnhancementOverride_StopOverride(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverride* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.DisplayEnhancementOverride", L"StopOverride", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* DisplayEnhancementOverride_get_ColorOverrideSettings(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverride* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayEnhancementOverride", L"ColorOverrideSettings"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static int DisplayEnhancementOverride_put_ColorOverrideSettings(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverride* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayEnhancementOverride", L"ColorOverrideSettings"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Graphics::Display::ColorOverrideSettings>(arg);

            self->obj.ColorOverrideSettings(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* DisplayEnhancementOverride_get_BrightnessOverrideSettings(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverride* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayEnhancementOverride", L"BrightnessOverrideSettings"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static int DisplayEnhancementOverride_put_BrightnessOverrideSettings(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverride* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayEnhancementOverride", L"BrightnessOverrideSettings"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Graphics::Display::BrightnessOverrideSettings>(arg);

            self->obj.BrightnessOverrideSettings(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* DisplayEnhancementOverride_get_CanOverride(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverride* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayEnhancementOverride", L"CanOverride"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* DisplayEnhancementOverride_get_IsOverrideActive(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverride* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayEnhancementOverride", L"IsOverrideActive"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* DisplayEnhancementOverride_add_CanOverrideChanged(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverride* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayEnhancementOverride", L"CanOverrideChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Graphics::Display::DisplayEnhancementOverride, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* DisplayEnhancementOverride_remove_CanOverrideChanged(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverride* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayEnhancementOverride", L"CanOverrideChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            self->obj.CanOverrideChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayEnhancementOverride_add_DisplayEnhancementOverrideCapabilitiesChanged(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverride* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayEnhancementOverride", L"DisplayEnhancementOverrideCapabilitiesChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Graphics::Display::DisplayEnhancementOverride, winrt::Windows::Graphics::Display::DisplayEnhancementOverrideCapabilitiesChangedEventArgs>>(arg);

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

    static PyObject* DisplayEnhancementOverride_remove_DisplayEnhancementOverrideCapabilitiesChanged(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverride* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayEnhancementOverride", L"DisplayEnhancementOverrideCapabilitiesChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            self->obj.DisplayEnhancementOverrideCapabilitiesChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayEnhancementOverride_add_IsOverrideActiveChanged(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverride* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayEnhancementOverride", L"IsOverrideActiveChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Graphics::Display::DisplayEnhancementOverride, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* DisplayEnhancementOverride_remove_IsOverrideActiveChanged(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverride* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayEnhancementOverride", L"IsOverrideActiveChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            self->obj.IsOverrideActiveChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

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

    static PyMethodDef _methods_DisplayEnhancementOverride[] = {
        { "get_current_display_enhancement_override_capabilities", reinterpret_cast<PyCFunction>(DisplayEnhancementOverride_GetCurrentDisplayEnhancementOverrideCapabilities), METH_VARARGS, nullptr },
        { "request_override", reinterpret_cast<PyCFunction>(DisplayEnhancementOverride_RequestOverride), METH_VARARGS, nullptr },
        { "stop_override", reinterpret_cast<PyCFunction>(DisplayEnhancementOverride_StopOverride), METH_VARARGS, nullptr },
        { "add_can_override_changed", reinterpret_cast<PyCFunction>(DisplayEnhancementOverride_add_CanOverrideChanged), METH_O, nullptr },
        { "remove_can_override_changed", reinterpret_cast<PyCFunction>(DisplayEnhancementOverride_remove_CanOverrideChanged), METH_O, nullptr },
        { "add_display_enhancement_override_capabilities_changed", reinterpret_cast<PyCFunction>(DisplayEnhancementOverride_add_DisplayEnhancementOverrideCapabilitiesChanged), METH_O, nullptr },
        { "remove_display_enhancement_override_capabilities_changed", reinterpret_cast<PyCFunction>(DisplayEnhancementOverride_remove_DisplayEnhancementOverrideCapabilitiesChanged), METH_O, nullptr },
        { "add_is_override_active_changed", reinterpret_cast<PyCFunction>(DisplayEnhancementOverride_add_IsOverrideActiveChanged), METH_O, nullptr },
        { "remove_is_override_active_changed", reinterpret_cast<PyCFunction>(DisplayEnhancementOverride_remove_IsOverrideActiveChanged), METH_O, nullptr },
        { "_assign_array_", _assign_array_DisplayEnhancementOverride, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DisplayEnhancementOverride), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_DisplayEnhancementOverride[] = {
        { "color_override_settings", reinterpret_cast<getter>(DisplayEnhancementOverride_get_ColorOverrideSettings), reinterpret_cast<setter>(DisplayEnhancementOverride_put_ColorOverrideSettings), nullptr, nullptr },
        { "brightness_override_settings", reinterpret_cast<getter>(DisplayEnhancementOverride_get_BrightnessOverrideSettings), reinterpret_cast<setter>(DisplayEnhancementOverride_put_BrightnessOverrideSettings), nullptr, nullptr },
        { "can_override", reinterpret_cast<getter>(DisplayEnhancementOverride_get_CanOverride), nullptr, nullptr, nullptr },
        { "is_override_active", reinterpret_cast<getter>(DisplayEnhancementOverride_get_IsOverrideActive), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_DisplayEnhancementOverride[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_DisplayEnhancementOverride) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DisplayEnhancementOverride) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DisplayEnhancementOverride) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DisplayEnhancementOverride) },
        { },
    };

    static PyType_Spec type_spec_DisplayEnhancementOverride =
    {
        "winrt._winrt_windows_graphics_display.DisplayEnhancementOverride",
        sizeof(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverride),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DisplayEnhancementOverride
    };

    static PyGetSetDef getset_DisplayEnhancementOverride_Static[] = {
        { }
    };

    static PyMethodDef methods_DisplayEnhancementOverride_Static[] = {
        { "get_for_current_view", reinterpret_cast<PyCFunction>(DisplayEnhancementOverride_GetForCurrentView), METH_VARARGS, nullptr },
        { }
    };

    static PyType_Slot type_slots_DisplayEnhancementOverride_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_DisplayEnhancementOverride_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_DisplayEnhancementOverride_Static) },
        { }
    };

    static PyType_Spec type_spec_DisplayEnhancementOverride_Static =
    {
        "winrt._winrt_windows_graphics_display.DisplayEnhancementOverride_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_DisplayEnhancementOverride_Static
    };

    // ----- DisplayEnhancementOverrideCapabilities class --------------------

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

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

    static PyObject* DisplayEnhancementOverrideCapabilities_GetSupportedNitRanges(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverrideCapabilities* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.DisplayEnhancementOverrideCapabilities", L"GetSupportedNitRanges", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* DisplayEnhancementOverrideCapabilities_get_IsBrightnessControlSupported(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverrideCapabilities* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayEnhancementOverrideCapabilities", L"IsBrightnessControlSupported"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* DisplayEnhancementOverrideCapabilities_get_IsBrightnessNitsControlSupported(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverrideCapabilities* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayEnhancementOverrideCapabilities", L"IsBrightnessNitsControlSupported"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

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

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

    static PyMethodDef _methods_DisplayEnhancementOverrideCapabilities[] = {
        { "get_supported_nit_ranges", reinterpret_cast<PyCFunction>(DisplayEnhancementOverrideCapabilities_GetSupportedNitRanges), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_DisplayEnhancementOverrideCapabilities, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DisplayEnhancementOverrideCapabilities), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_DisplayEnhancementOverrideCapabilities[] = {
        { "is_brightness_control_supported", reinterpret_cast<getter>(DisplayEnhancementOverrideCapabilities_get_IsBrightnessControlSupported), nullptr, nullptr, nullptr },
        { "is_brightness_nits_control_supported", reinterpret_cast<getter>(DisplayEnhancementOverrideCapabilities_get_IsBrightnessNitsControlSupported), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_DisplayEnhancementOverrideCapabilities[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_DisplayEnhancementOverrideCapabilities) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DisplayEnhancementOverrideCapabilities) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DisplayEnhancementOverrideCapabilities) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DisplayEnhancementOverrideCapabilities) },
        { },
    };

    static PyType_Spec type_spec_DisplayEnhancementOverrideCapabilities =
    {
        "winrt._winrt_windows_graphics_display.DisplayEnhancementOverrideCapabilities",
        sizeof(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverrideCapabilities),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DisplayEnhancementOverrideCapabilities
    };

    // ----- DisplayEnhancementOverrideCapabilitiesChangedEventArgs class --------------------

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

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

    static PyObject* DisplayEnhancementOverrideCapabilitiesChangedEventArgs_get_Capabilities(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverrideCapabilitiesChangedEventArgs* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayEnhancementOverrideCapabilitiesChangedEventArgs", L"Capabilities"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

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

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

    static PyMethodDef _methods_DisplayEnhancementOverrideCapabilitiesChangedEventArgs[] = {
        { "_assign_array_", _assign_array_DisplayEnhancementOverrideCapabilitiesChangedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DisplayEnhancementOverrideCapabilitiesChangedEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_DisplayEnhancementOverrideCapabilitiesChangedEventArgs[] = {
        { "capabilities", reinterpret_cast<getter>(DisplayEnhancementOverrideCapabilitiesChangedEventArgs_get_Capabilities), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_DisplayEnhancementOverrideCapabilitiesChangedEventArgs[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_DisplayEnhancementOverrideCapabilitiesChangedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DisplayEnhancementOverrideCapabilitiesChangedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DisplayEnhancementOverrideCapabilitiesChangedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DisplayEnhancementOverrideCapabilitiesChangedEventArgs) },
        { },
    };

    static PyType_Spec type_spec_DisplayEnhancementOverrideCapabilitiesChangedEventArgs =
    {
        "winrt._winrt_windows_graphics_display.DisplayEnhancementOverrideCapabilitiesChangedEventArgs",
        sizeof(py::wrapper::Windows::Graphics::Display::DisplayEnhancementOverrideCapabilitiesChangedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DisplayEnhancementOverrideCapabilitiesChangedEventArgs
    };

    // ----- DisplayInformation class --------------------

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

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

    static PyObject* DisplayInformation_GetAdvancedColorInfo(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.DisplayInformation", L"GetAdvancedColorInfo", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* DisplayInformation_GetColorProfileAsync(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.DisplayInformation", L"GetColorProfileAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

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

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.DisplayInformation", L"GetForCurrentView", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Graphics::Display::DisplayInformation::GetForCurrentView());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DisplayInformation_get_CurrentOrientation(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayInformation", L"CurrentOrientation"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* DisplayInformation_get_LogicalDpi(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayInformation", L"LogicalDpi"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* DisplayInformation_get_NativeOrientation(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayInformation", L"NativeOrientation"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* DisplayInformation_get_RawDpiX(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayInformation", L"RawDpiX"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* DisplayInformation_get_RawDpiY(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayInformation", L"RawDpiY"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* DisplayInformation_get_ResolutionScale(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayInformation", L"ResolutionScale"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* DisplayInformation_get_StereoEnabled(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayInformation", L"StereoEnabled"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* DisplayInformation_get_RawPixelsPerViewPixel(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayInformation", L"RawPixelsPerViewPixel"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* DisplayInformation_get_DiagonalSizeInInches(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayInformation", L"DiagonalSizeInInches"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* DisplayInformation_get_ScreenHeightInRawPixels(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayInformation", L"ScreenHeightInRawPixels"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* DisplayInformation_get_ScreenWidthInRawPixels(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayInformation", L"ScreenWidthInRawPixels"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* DisplayInformation_get_AutoRotationPreferences(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayInformation", L"AutoRotationPreferences"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Graphics::Display::DisplayInformation::AutoRotationPreferences());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int DisplayInformation_put_AutoRotationPreferences(PyObject* /*unused*/, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayInformation", L"AutoRotationPreferences"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Graphics::Display::DisplayOrientations>(arg);

            winrt::Windows::Graphics::Display::DisplayInformation::AutoRotationPreferences(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* DisplayInformation_add_ColorProfileChanged(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayInformation", L"ColorProfileChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Graphics::Display::DisplayInformation, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* DisplayInformation_remove_ColorProfileChanged(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayInformation", L"ColorProfileChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            self->obj.ColorProfileChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayInformation_add_DpiChanged(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayInformation", L"DpiChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Graphics::Display::DisplayInformation, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* DisplayInformation_remove_DpiChanged(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayInformation", L"DpiChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            self->obj.DpiChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayInformation_add_OrientationChanged(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayInformation", L"OrientationChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Graphics::Display::DisplayInformation, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* DisplayInformation_remove_OrientationChanged(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayInformation", L"OrientationChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            self->obj.OrientationChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayInformation_add_StereoEnabledChanged(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayInformation", L"StereoEnabledChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Graphics::Display::DisplayInformation, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* DisplayInformation_remove_StereoEnabledChanged(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayInformation", L"StereoEnabledChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            self->obj.StereoEnabledChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayInformation_add_AdvancedColorInfoChanged(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayInformation", L"AdvancedColorInfoChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Graphics::Display::DisplayInformation, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* DisplayInformation_remove_AdvancedColorInfoChanged(py::wrapper::Windows::Graphics::Display::DisplayInformation* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayInformation", L"AdvancedColorInfoChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            self->obj.AdvancedColorInfoChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayInformation_add_DisplayContentsInvalidated(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayInformation", L"DisplayContentsInvalidated"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Graphics::Display::DisplayInformation, winrt::Windows::Foundation::IInspectable>>(arg);

            return py::convert(winrt::Windows::Graphics::Display::DisplayInformation::DisplayContentsInvalidated(param0));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayInformation_remove_DisplayContentsInvalidated(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayInformation", L"DisplayContentsInvalidated"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            winrt::Windows::Graphics::Display::DisplayInformation::DisplayContentsInvalidated(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

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

    static PyMethodDef _methods_DisplayInformation[] = {
        { "get_advanced_color_info", reinterpret_cast<PyCFunction>(DisplayInformation_GetAdvancedColorInfo), METH_VARARGS, nullptr },
        { "get_color_profile_async", reinterpret_cast<PyCFunction>(DisplayInformation_GetColorProfileAsync), METH_VARARGS, nullptr },
        { "add_color_profile_changed", reinterpret_cast<PyCFunction>(DisplayInformation_add_ColorProfileChanged), METH_O, nullptr },
        { "remove_color_profile_changed", reinterpret_cast<PyCFunction>(DisplayInformation_remove_ColorProfileChanged), METH_O, nullptr },
        { "add_dpi_changed", reinterpret_cast<PyCFunction>(DisplayInformation_add_DpiChanged), METH_O, nullptr },
        { "remove_dpi_changed", reinterpret_cast<PyCFunction>(DisplayInformation_remove_DpiChanged), METH_O, nullptr },
        { "add_orientation_changed", reinterpret_cast<PyCFunction>(DisplayInformation_add_OrientationChanged), METH_O, nullptr },
        { "remove_orientation_changed", reinterpret_cast<PyCFunction>(DisplayInformation_remove_OrientationChanged), METH_O, nullptr },
        { "add_stereo_enabled_changed", reinterpret_cast<PyCFunction>(DisplayInformation_add_StereoEnabledChanged), METH_O, nullptr },
        { "remove_stereo_enabled_changed", reinterpret_cast<PyCFunction>(DisplayInformation_remove_StereoEnabledChanged), METH_O, nullptr },
        { "add_advanced_color_info_changed", reinterpret_cast<PyCFunction>(DisplayInformation_add_AdvancedColorInfoChanged), METH_O, nullptr },
        { "remove_advanced_color_info_changed", reinterpret_cast<PyCFunction>(DisplayInformation_remove_AdvancedColorInfoChanged), METH_O, nullptr },
        { "add_display_contents_invalidated", reinterpret_cast<PyCFunction>(DisplayInformation_add_DisplayContentsInvalidated), METH_O | METH_STATIC, nullptr },
        { "remove_display_contents_invalidated", reinterpret_cast<PyCFunction>(DisplayInformation_remove_DisplayContentsInvalidated), METH_O | METH_STATIC, nullptr },
        { "_assign_array_", _assign_array_DisplayInformation, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DisplayInformation), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_DisplayInformation[] = {
        { "current_orientation", reinterpret_cast<getter>(DisplayInformation_get_CurrentOrientation), nullptr, nullptr, nullptr },
        { "logical_dpi", reinterpret_cast<getter>(DisplayInformation_get_LogicalDpi), nullptr, nullptr, nullptr },
        { "native_orientation", reinterpret_cast<getter>(DisplayInformation_get_NativeOrientation), nullptr, nullptr, nullptr },
        { "raw_dpi_x", reinterpret_cast<getter>(DisplayInformation_get_RawDpiX), nullptr, nullptr, nullptr },
        { "raw_dpi_y", reinterpret_cast<getter>(DisplayInformation_get_RawDpiY), nullptr, nullptr, nullptr },
        { "resolution_scale", reinterpret_cast<getter>(DisplayInformation_get_ResolutionScale), nullptr, nullptr, nullptr },
        { "stereo_enabled", reinterpret_cast<getter>(DisplayInformation_get_StereoEnabled), nullptr, nullptr, nullptr },
        { "raw_pixels_per_view_pixel", reinterpret_cast<getter>(DisplayInformation_get_RawPixelsPerViewPixel), nullptr, nullptr, nullptr },
        { "diagonal_size_in_inches", reinterpret_cast<getter>(DisplayInformation_get_DiagonalSizeInInches), nullptr, nullptr, nullptr },
        { "screen_height_in_raw_pixels", reinterpret_cast<getter>(DisplayInformation_get_ScreenHeightInRawPixels), nullptr, nullptr, nullptr },
        { "screen_width_in_raw_pixels", reinterpret_cast<getter>(DisplayInformation_get_ScreenWidthInRawPixels), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_DisplayInformation[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_DisplayInformation) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DisplayInformation) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DisplayInformation) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DisplayInformation) },
        { },
    };

    static PyType_Spec type_spec_DisplayInformation =
    {
        "winrt._winrt_windows_graphics_display.DisplayInformation",
        sizeof(py::wrapper::Windows::Graphics::Display::DisplayInformation),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DisplayInformation
    };

    static PyGetSetDef getset_DisplayInformation_Static[] = {
        { "auto_rotation_preferences", reinterpret_cast<getter>(DisplayInformation_get_AutoRotationPreferences), reinterpret_cast<setter>(DisplayInformation_put_AutoRotationPreferences), nullptr, nullptr },
        { }
    };

    static PyMethodDef methods_DisplayInformation_Static[] = {
        { "get_for_current_view", reinterpret_cast<PyCFunction>(DisplayInformation_GetForCurrentView), METH_VARARGS, nullptr },
        { }
    };

    static PyType_Slot type_slots_DisplayInformation_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_DisplayInformation_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_DisplayInformation_Static) },
        { }
    };

    static PyType_Spec type_spec_DisplayInformation_Static =
    {
        "winrt._winrt_windows_graphics_display.DisplayInformation_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_DisplayInformation_Static
    };

    // ----- DisplayProperties class --------------------

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

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

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.DisplayProperties", L"GetColorProfileAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Graphics::Display::DisplayProperties::GetColorProfileAsync());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DisplayProperties_get_AutoRotationPreferences(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayProperties", L"AutoRotationPreferences"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Graphics::Display::DisplayProperties::AutoRotationPreferences());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int DisplayProperties_put_AutoRotationPreferences(PyObject* /*unused*/, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayProperties", L"AutoRotationPreferences"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Graphics::Display::DisplayOrientations>(arg);

            winrt::Windows::Graphics::Display::DisplayProperties::AutoRotationPreferences(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* DisplayProperties_get_CurrentOrientation(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayProperties", L"CurrentOrientation"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Graphics::Display::DisplayProperties::CurrentOrientation());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayProperties_get_LogicalDpi(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayProperties", L"LogicalDpi"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Graphics::Display::DisplayProperties::LogicalDpi());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayProperties_get_NativeOrientation(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayProperties", L"NativeOrientation"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Graphics::Display::DisplayProperties::NativeOrientation());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayProperties_get_ResolutionScale(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayProperties", L"ResolutionScale"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Graphics::Display::DisplayProperties::ResolutionScale());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayProperties_get_StereoEnabled(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.DisplayProperties", L"StereoEnabled"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Graphics::Display::DisplayProperties::StereoEnabled());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayProperties_add_ColorProfileChanged(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayProperties", L"ColorProfileChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler>(arg);

            return py::convert(winrt::Windows::Graphics::Display::DisplayProperties::ColorProfileChanged(param0));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayProperties_remove_ColorProfileChanged(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayProperties", L"ColorProfileChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            winrt::Windows::Graphics::Display::DisplayProperties::ColorProfileChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayProperties_add_DisplayContentsInvalidated(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayProperties", L"DisplayContentsInvalidated"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler>(arg);

            return py::convert(winrt::Windows::Graphics::Display::DisplayProperties::DisplayContentsInvalidated(param0));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayProperties_remove_DisplayContentsInvalidated(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayProperties", L"DisplayContentsInvalidated"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            winrt::Windows::Graphics::Display::DisplayProperties::DisplayContentsInvalidated(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayProperties_add_LogicalDpiChanged(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayProperties", L"LogicalDpiChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler>(arg);

            return py::convert(winrt::Windows::Graphics::Display::DisplayProperties::LogicalDpiChanged(param0));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayProperties_remove_LogicalDpiChanged(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayProperties", L"LogicalDpiChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            winrt::Windows::Graphics::Display::DisplayProperties::LogicalDpiChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayProperties_add_OrientationChanged(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayProperties", L"OrientationChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler>(arg);

            return py::convert(winrt::Windows::Graphics::Display::DisplayProperties::OrientationChanged(param0));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayProperties_remove_OrientationChanged(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayProperties", L"OrientationChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            winrt::Windows::Graphics::Display::DisplayProperties::OrientationChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayProperties_add_StereoEnabledChanged(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayProperties", L"StereoEnabledChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Graphics::Display::DisplayPropertiesEventHandler>(arg);

            return py::convert(winrt::Windows::Graphics::Display::DisplayProperties::StereoEnabledChanged(param0));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DisplayProperties_remove_StereoEnabledChanged(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.DisplayProperties", L"StereoEnabledChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            winrt::Windows::Graphics::Display::DisplayProperties::StereoEnabledChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_DisplayProperties[] = {
        { "add_color_profile_changed", reinterpret_cast<PyCFunction>(DisplayProperties_add_ColorProfileChanged), METH_O | METH_STATIC, nullptr },
        { "remove_color_profile_changed", reinterpret_cast<PyCFunction>(DisplayProperties_remove_ColorProfileChanged), METH_O | METH_STATIC, nullptr },
        { "add_display_contents_invalidated", reinterpret_cast<PyCFunction>(DisplayProperties_add_DisplayContentsInvalidated), METH_O | METH_STATIC, nullptr },
        { "remove_display_contents_invalidated", reinterpret_cast<PyCFunction>(DisplayProperties_remove_DisplayContentsInvalidated), METH_O | METH_STATIC, nullptr },
        { "add_logical_dpi_changed", reinterpret_cast<PyCFunction>(DisplayProperties_add_LogicalDpiChanged), METH_O | METH_STATIC, nullptr },
        { "remove_logical_dpi_changed", reinterpret_cast<PyCFunction>(DisplayProperties_remove_LogicalDpiChanged), METH_O | METH_STATIC, nullptr },
        { "add_orientation_changed", reinterpret_cast<PyCFunction>(DisplayProperties_add_OrientationChanged), METH_O | METH_STATIC, nullptr },
        { "remove_orientation_changed", reinterpret_cast<PyCFunction>(DisplayProperties_remove_OrientationChanged), METH_O | METH_STATIC, nullptr },
        { "add_stereo_enabled_changed", reinterpret_cast<PyCFunction>(DisplayProperties_add_StereoEnabledChanged), METH_O | METH_STATIC, nullptr },
        { "remove_stereo_enabled_changed", reinterpret_cast<PyCFunction>(DisplayProperties_remove_StereoEnabledChanged), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_DisplayProperties[] = {
        { }
    };

    static PyType_Slot _type_slots_DisplayProperties[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_DisplayProperties) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DisplayProperties) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DisplayProperties) },
        { },
    };

    static PyType_Spec type_spec_DisplayProperties =
    {
        "winrt._winrt_windows_graphics_display.DisplayProperties",
        0,
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DisplayProperties
    };

    static PyGetSetDef getset_DisplayProperties_Static[] = {
        { "auto_rotation_preferences", reinterpret_cast<getter>(DisplayProperties_get_AutoRotationPreferences), reinterpret_cast<setter>(DisplayProperties_put_AutoRotationPreferences), nullptr, nullptr },
        { "current_orientation", reinterpret_cast<getter>(DisplayProperties_get_CurrentOrientation), nullptr, nullptr, nullptr },
        { "logical_dpi", reinterpret_cast<getter>(DisplayProperties_get_LogicalDpi), nullptr, nullptr, nullptr },
        { "native_orientation", reinterpret_cast<getter>(DisplayProperties_get_NativeOrientation), nullptr, nullptr, nullptr },
        { "resolution_scale", reinterpret_cast<getter>(DisplayProperties_get_ResolutionScale), nullptr, nullptr, nullptr },
        { "stereo_enabled", reinterpret_cast<getter>(DisplayProperties_get_StereoEnabled), nullptr, nullptr, nullptr },
        { }
    };

    static PyMethodDef methods_DisplayProperties_Static[] = {
        { "get_color_profile_async", reinterpret_cast<PyCFunction>(DisplayProperties_GetColorProfileAsync), METH_VARARGS, nullptr },
        { }
    };

    static PyType_Slot type_slots_DisplayProperties_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_DisplayProperties_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_DisplayProperties_Static) },
        { }
    };

    static PyType_Spec type_spec_DisplayProperties_Static =
    {
        "winrt._winrt_windows_graphics_display.DisplayProperties_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_DisplayProperties_Static
    };

    // ----- DisplayServices class --------------------

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

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

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

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.DisplayServices", L"FindAll", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Graphics::Display::DisplayServices::FindAll());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

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

    static PyMethodDef _methods_DisplayServices[] = {
        { "_assign_array_", _assign_array_DisplayServices, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DisplayServices), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_DisplayServices[] = {
        { }
    };

    static PyType_Slot _type_slots_DisplayServices[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_DisplayServices) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_DisplayServices) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_DisplayServices) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_DisplayServices) },
        { },
    };

    static PyType_Spec type_spec_DisplayServices =
    {
        "winrt._winrt_windows_graphics_display.DisplayServices",
        sizeof(py::wrapper::Windows::Graphics::Display::DisplayServices),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DisplayServices
    };

    static PyGetSetDef getset_DisplayServices_Static[] = {
        { }
    };

    static PyMethodDef methods_DisplayServices_Static[] = {
        { "find_all", reinterpret_cast<PyCFunction>(DisplayServices_FindAll), METH_VARARGS, nullptr },
        { }
    };

    static PyType_Slot type_slots_DisplayServices_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_DisplayServices_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_DisplayServices_Static) },
        { }
    };

    static PyType_Spec type_spec_DisplayServices_Static =
    {
        "winrt._winrt_windows_graphics_display.DisplayServices_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_DisplayServices_Static
    };

    // ----- NitRange struct --------------------

    winrt_struct_wrapper<winrt::Windows::Graphics::Display::NitRange>* _new_NitRange(PyTypeObject* subclass, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        auto self = reinterpret_cast<winrt_struct_wrapper<winrt::Windows::Graphics::Display::NitRange>*>(subclass->tp_alloc(subclass, 0));

        if (!self)
        {
            return nullptr;
        }

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

        return self;
    }

    int _init_NitRange(winrt_struct_wrapper<winrt::Windows::Graphics::Display::NitRange>* self, PyObject* args, PyObject* kwds) noexcept
    {
        auto tuple_size = PyTuple_Size(args);

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

        float _MinNits{};
        float _MaxNits{};
        float _StepSizeNits{};

        static const char* kwlist[] = {"min_nits", "max_nits", "step_size_nits", nullptr};
        if (!PyArg_ParseTupleAndKeywords(args, kwds, "fff", const_cast<char**>(kwlist), &_MinNits, &_MaxNits, &_StepSizeNits))
        {
            return -1;
        }

        try
        {
            self->obj = {_MinNits, _MaxNits, _StepSizeNits};
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

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

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

    static PyMethodDef _methods_NitRange[] = {
        { "_assign_array_", _assign_array_NitRange, METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyObject* NitRange_get_MinNits(py::wrapper::Windows::Graphics::Display::NitRange* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.MinNits);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int NitRange_set_MinNits(py::wrapper::Windows::Graphics::Display::NitRange* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

    static PyObject* NitRange_get_MaxNits(py::wrapper::Windows::Graphics::Display::NitRange* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.MaxNits);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int NitRange_set_MaxNits(py::wrapper::Windows::Graphics::Display::NitRange* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

    static PyObject* NitRange_get_StepSizeNits(py::wrapper::Windows::Graphics::Display::NitRange* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.StepSizeNits);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int NitRange_set_StepSizeNits(py::wrapper::Windows::Graphics::Display::NitRange* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

    static PyGetSetDef _getset_NitRange[] = {
        { "min_nits", reinterpret_cast<getter>(NitRange_get_MinNits), reinterpret_cast<setter>(NitRange_set_MinNits), nullptr, nullptr },
        { "max_nits", reinterpret_cast<getter>(NitRange_get_MaxNits), reinterpret_cast<setter>(NitRange_set_MaxNits), nullptr, nullptr },
        { "step_size_nits", reinterpret_cast<getter>(NitRange_get_StepSizeNits), reinterpret_cast<setter>(NitRange_set_StepSizeNits), nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_NitRange[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_NitRange) },
        { Py_tp_init, reinterpret_cast<void*>(_init_NitRange) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_NitRange) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_NitRange) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_NitRange) },
        { },
    };

    static PyType_Spec type_spec_NitRange =
    {
        "winrt._winrt_windows_graphics_display.NitRange",
        sizeof(py::wrapper::Windows::Graphics::Display::NitRange),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_NitRange
    };

    // ----- Windows.Graphics.Display Initialization --------------------
    PyDoc_STRVAR(module_doc, "Windows::Graphics::Display");


    static PyModuleDef module_def
        = {PyModuleDef_HEAD_INIT,
           "_winrt_windows_graphics_display",
           module_doc,
           0,
           nullptr,
           nullptr,
           nullptr,
           nullptr,
           nullptr};

} // py::cpp::Windows::Graphics::Display

PyMODINIT_FUNC PyInit__winrt_windows_graphics_display(void) noexcept
{
    using namespace py::cpp::Windows::Graphics::Display;

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

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

    if (!module)
    {
        return nullptr;
    }

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

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

    if (!object_bases)
    {
        return nullptr;
    }

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

    py::pyobj_handle type_BrightnessOverride_Static{PyType_FromSpec(&type_spec_BrightnessOverride_Static)};
    if (!type_BrightnessOverride_Static)
    {
        return nullptr;
    }

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

    py::pyobj_handle type_BrightnessOverrideSettings_Static{PyType_FromSpec(&type_spec_BrightnessOverrideSettings_Static)};
    if (!type_BrightnessOverrideSettings_Static)
    {
        return nullptr;
    }

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

    py::pyobj_handle type_ColorOverrideSettings_Static{PyType_FromSpec(&type_spec_ColorOverrideSettings_Static)};
    if (!type_ColorOverrideSettings_Static)
    {
        return nullptr;
    }

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

    py::pyobj_handle type_DisplayEnhancementOverride_Static{PyType_FromSpec(&type_spec_DisplayEnhancementOverride_Static)};
    if (!type_DisplayEnhancementOverride_Static)
    {
        return nullptr;
    }

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

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

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

    py::pyobj_handle type_DisplayInformation_Static{PyType_FromSpec(&type_spec_DisplayInformation_Static)};
    if (!type_DisplayInformation_Static)
    {
        return nullptr;
    }

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

    py::pyobj_handle type_DisplayProperties_Static{PyType_FromSpec(&type_spec_DisplayProperties_Static)};
    if (!type_DisplayProperties_Static)
    {
        return nullptr;
    }

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

    py::pyobj_handle type_DisplayServices_Static{PyType_FromSpec(&type_spec_DisplayServices_Static)};
    if (!type_DisplayServices_Static)
    {
        return nullptr;
    }

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

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


    return module.detach();
}
