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

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

namespace py::cpp::Windows::Graphics::Display::Core
{
    // ----- HdmiDisplayInformation class --------------------

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

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

    static PyObject* HdmiDisplayInformation_GetCurrentDisplayMode(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayInformation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

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

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.Core.HdmiDisplayInformation", L"GetCurrentDisplayMode", 0);
                }

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

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

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

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

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.Core.HdmiDisplayInformation", L"GetForCurrentView", 0);
                }

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

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return winrt::Windows::Graphics::Display::Core::HdmiDisplayInformation::GetForCurrentView();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* HdmiDisplayInformation_GetSupportedDisplayModes(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayInformation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

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

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.Core.HdmiDisplayInformation", L"GetSupportedDisplayModes", 0);
                }

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

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

    static PyObject* HdmiDisplayInformation_RequestSetCurrentDisplayModeAsync(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayInformation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

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

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.Core.HdmiDisplayInformation", L"RequestSetCurrentDisplayModeAsync", 1);
                }

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

                auto param0 = py::convert_to<winrt::Windows::Graphics::Display::Core::HdmiDisplayMode>(args, 0);

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

    static PyObject* HdmiDisplayInformation_RequestSetCurrentDisplayModeWithHdrAndMetadataAsync(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayInformation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

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

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.Core.HdmiDisplayInformation", L"RequestSetCurrentDisplayModeAsync", 3);
                }

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

                auto param0 = py::convert_to<winrt::Windows::Graphics::Display::Core::HdmiDisplayMode>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Graphics::Display::Core::HdmiDisplayHdrOption>(args, 1);
                auto param2 = py::convert_to<winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata>(args, 2);

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

    static PyObject* HdmiDisplayInformation_RequestSetCurrentDisplayModeWithHdrAsync(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayInformation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

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

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.Core.HdmiDisplayInformation", L"RequestSetCurrentDisplayModeAsync", 2);
                }

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

                auto param0 = py::convert_to<winrt::Windows::Graphics::Display::Core::HdmiDisplayMode>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Graphics::Display::Core::HdmiDisplayHdrOption>(args, 1);

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

    static PyObject* HdmiDisplayInformation_SetDefaultDisplayModeAsync(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayInformation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

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

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.Core.HdmiDisplayInformation", L"SetDefaultDisplayModeAsync", 0);
                }

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

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

    static PyObject* HdmiDisplayInformation_add_DisplayModesChanged(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayInformation* self, PyObject* arg) noexcept
    {
        try
        {
            static std::optional<bool> is_event_present{};

            if (!is_event_present.has_value())
            {
                is_event_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.Core.HdmiDisplayInformation", L"DisplayModesChanged");
            }

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

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

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

    static PyObject* HdmiDisplayInformation_remove_DisplayModesChanged(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayInformation* self, PyObject* arg) noexcept
    {
        try
        {
            static std::optional<bool> is_event_present{};

            if (!is_event_present.has_value())
            {
                is_event_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.Core.HdmiDisplayInformation", L"DisplayModesChanged");
            }

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

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

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

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

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

    static PyObject* _from_HdmiDisplayInformation(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::Core::HdmiDisplayInformation>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_HdmiDisplayInformation[] = {
        { "get_current_display_mode", reinterpret_cast<PyCFunction>(HdmiDisplayInformation_GetCurrentDisplayMode), METH_VARARGS, nullptr },
        { "get_supported_display_modes", reinterpret_cast<PyCFunction>(HdmiDisplayInformation_GetSupportedDisplayModes), METH_VARARGS, nullptr },
        { "request_set_current_display_mode_async", reinterpret_cast<PyCFunction>(HdmiDisplayInformation_RequestSetCurrentDisplayModeAsync), METH_VARARGS, nullptr },
        { "request_set_current_display_mode_with_hdr_and_metadata_async", reinterpret_cast<PyCFunction>(HdmiDisplayInformation_RequestSetCurrentDisplayModeWithHdrAndMetadataAsync), METH_VARARGS, nullptr },
        { "request_set_current_display_mode_with_hdr_async", reinterpret_cast<PyCFunction>(HdmiDisplayInformation_RequestSetCurrentDisplayModeWithHdrAsync), METH_VARARGS, nullptr },
        { "set_default_display_mode_async", reinterpret_cast<PyCFunction>(HdmiDisplayInformation_SetDefaultDisplayModeAsync), METH_VARARGS, nullptr },
        { "add_display_modes_changed", reinterpret_cast<PyCFunction>(HdmiDisplayInformation_add_DisplayModesChanged), METH_O, nullptr },
        { "remove_display_modes_changed", reinterpret_cast<PyCFunction>(HdmiDisplayInformation_remove_DisplayModesChanged), METH_O, nullptr },
        { "_assign_array_", _assign_array_HdmiDisplayInformation, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_HdmiDisplayInformation), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_HdmiDisplayInformation[] = {
        { }};

    static PyType_Slot _type_slots_HdmiDisplayInformation[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_HdmiDisplayInformation) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_HdmiDisplayInformation) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_HdmiDisplayInformation) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_HdmiDisplayInformation) },
        { }};

    static PyType_Spec type_spec_HdmiDisplayInformation = {
        "winrt._winrt_windows_graphics_display_core.HdmiDisplayInformation",
        sizeof(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayInformation),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_HdmiDisplayInformation};

    static PyGetSetDef getset_HdmiDisplayInformation_Static[] = {
        { }};

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

    static PyType_Slot type_slots_HdmiDisplayInformation_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_HdmiDisplayInformation_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_HdmiDisplayInformation_Static) },
        { }
    };

    static PyType_Spec type_spec_HdmiDisplayInformation_Static = {
        "winrt._winrt_windows_graphics_display_core.HdmiDisplayInformation_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_HdmiDisplayInformation_Static};

    // ----- HdmiDisplayMode class --------------------

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

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

    static PyObject* HdmiDisplayMode_IsEqual(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayMode* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

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

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"IsEqual", 1);
                }

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

                auto param0 = py::convert_to<winrt::Windows::Graphics::Display::Core::HdmiDisplayMode>(args, 0);

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

    static PyObject* HdmiDisplayMode_get_BitsPerPixel(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayMode* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"BitsPerPixel");
            }

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

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

    static PyObject* HdmiDisplayMode_get_ColorSpace(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayMode* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"ColorSpace");
            }

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

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

    static PyObject* HdmiDisplayMode_get_Is2086MetadataSupported(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayMode* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"Is2086MetadataSupported");
            }

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

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

    static PyObject* HdmiDisplayMode_get_IsSdrLuminanceSupported(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayMode* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"IsSdrLuminanceSupported");
            }

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

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

    static PyObject* HdmiDisplayMode_get_IsSmpte2084Supported(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayMode* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"IsSmpte2084Supported");
            }

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

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

    static PyObject* HdmiDisplayMode_get_PixelEncoding(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayMode* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"PixelEncoding");
            }

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

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

    static PyObject* HdmiDisplayMode_get_RefreshRate(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayMode* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"RefreshRate");
            }

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

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

    static PyObject* HdmiDisplayMode_get_ResolutionHeightInRawPixels(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayMode* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"ResolutionHeightInRawPixels");
            }

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

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

    static PyObject* HdmiDisplayMode_get_ResolutionWidthInRawPixels(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayMode* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"ResolutionWidthInRawPixels");
            }

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

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

    static PyObject* HdmiDisplayMode_get_StereoEnabled(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayMode* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"StereoEnabled");
            }

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

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

    static PyObject* HdmiDisplayMode_get_IsDolbyVisionLowLatencySupported(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayMode* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"IsDolbyVisionLowLatencySupported");
            }

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

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

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

    static PyObject* _from_HdmiDisplayMode(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::Core::HdmiDisplayMode>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_HdmiDisplayMode[] = {
        { "is_equal", reinterpret_cast<PyCFunction>(HdmiDisplayMode_IsEqual), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_HdmiDisplayMode, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_HdmiDisplayMode), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_HdmiDisplayMode[] = {
        { "bits_per_pixel", reinterpret_cast<getter>(HdmiDisplayMode_get_BitsPerPixel), nullptr, nullptr, nullptr },
        { "color_space", reinterpret_cast<getter>(HdmiDisplayMode_get_ColorSpace), nullptr, nullptr, nullptr },
        { "is2086_metadata_supported", reinterpret_cast<getter>(HdmiDisplayMode_get_Is2086MetadataSupported), nullptr, nullptr, nullptr },
        { "is_sdr_luminance_supported", reinterpret_cast<getter>(HdmiDisplayMode_get_IsSdrLuminanceSupported), nullptr, nullptr, nullptr },
        { "is_smpte2084_supported", reinterpret_cast<getter>(HdmiDisplayMode_get_IsSmpte2084Supported), nullptr, nullptr, nullptr },
        { "pixel_encoding", reinterpret_cast<getter>(HdmiDisplayMode_get_PixelEncoding), nullptr, nullptr, nullptr },
        { "refresh_rate", reinterpret_cast<getter>(HdmiDisplayMode_get_RefreshRate), nullptr, nullptr, nullptr },
        { "resolution_height_in_raw_pixels", reinterpret_cast<getter>(HdmiDisplayMode_get_ResolutionHeightInRawPixels), nullptr, nullptr, nullptr },
        { "resolution_width_in_raw_pixels", reinterpret_cast<getter>(HdmiDisplayMode_get_ResolutionWidthInRawPixels), nullptr, nullptr, nullptr },
        { "stereo_enabled", reinterpret_cast<getter>(HdmiDisplayMode_get_StereoEnabled), nullptr, nullptr, nullptr },
        { "is_dolby_vision_low_latency_supported", reinterpret_cast<getter>(HdmiDisplayMode_get_IsDolbyVisionLowLatencySupported), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_HdmiDisplayMode[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_HdmiDisplayMode) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_HdmiDisplayMode) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_HdmiDisplayMode) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_HdmiDisplayMode) },
        { }};

    static PyType_Spec type_spec_HdmiDisplayMode = {
        "winrt._winrt_windows_graphics_display_core.HdmiDisplayMode",
        sizeof(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayMode),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_HdmiDisplayMode};

    // ----- HdmiDisplayHdr2086Metadata struct --------------------

    winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata HdmiDisplayHdr2086Metadata_from_tuple(PyObject* tuple)
    {
        if (PyTuple_GET_SIZE(tuple) != 12)
        {
            PyErr_SetString(PyExc_TypeError, "Incorrect number of fields");
            throw python_exception();
        }

        winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata result{};

        result.RedPrimaryX = py::convert_to<uint16_t>(tuple, 0);
        result.RedPrimaryY = py::convert_to<uint16_t>(tuple, 1);
        result.GreenPrimaryX = py::convert_to<uint16_t>(tuple, 2);
        result.GreenPrimaryY = py::convert_to<uint16_t>(tuple, 3);
        result.BluePrimaryX = py::convert_to<uint16_t>(tuple, 4);
        result.BluePrimaryY = py::convert_to<uint16_t>(tuple, 5);
        result.WhitePointX = py::convert_to<uint16_t>(tuple, 6);
        result.WhitePointY = py::convert_to<uint16_t>(tuple, 7);
        result.MaxMasteringLuminance = py::convert_to<uint16_t>(tuple, 8);
        result.MinMasteringLuminance = py::convert_to<uint16_t>(tuple, 9);
        result.MaxContentLightLevel = py::convert_to<uint16_t>(tuple, 10);
        result.MaxFrameAverageLightLevel = py::convert_to<uint16_t>(tuple, 11);

        return result;
    }

    PyObject* _new_HdmiDisplayHdr2086Metadata(PyTypeObject* subclass, PyObject* args, PyObject* kwds) noexcept
    {
        pyobj_handle self_obj{(subclass->tp_alloc(subclass, 0))};
        if (!self_obj)
        {
            return nullptr;
        }

        auto self = reinterpret_cast<winrt_struct_wrapper<winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata>*>(self_obj.get());
        std::construct_at(&self->obj);

        auto tuple_size = PyTuple_GET_SIZE(args);
        if ((tuple_size == 0) && (!kwds))
        {
            return self_obj.detach();
        }

        uint16_t _RedPrimaryX{};
        uint16_t _RedPrimaryY{};
        uint16_t _GreenPrimaryX{};
        uint16_t _GreenPrimaryY{};
        uint16_t _BluePrimaryX{};
        uint16_t _BluePrimaryY{};
        uint16_t _WhitePointX{};
        uint16_t _WhitePointY{};
        uint16_t _MaxMasteringLuminance{};
        uint16_t _MinMasteringLuminance{};
        uint16_t _MaxContentLightLevel{};
        uint16_t _MaxFrameAverageLightLevel{};

        static const char* kwlist[] = {"red_primary_x", "red_primary_y", "green_primary_x", "green_primary_y", "blue_primary_x", "blue_primary_y", "white_point_x", "white_point_y", "max_mastering_luminance", "min_mastering_luminance", "max_content_light_level", "max_frame_average_light_level", nullptr};
        if (!PyArg_ParseTupleAndKeywords(args, kwds, "|HHHHHHHHHHHH", const_cast<char**>(kwlist), &_RedPrimaryX, &_RedPrimaryY, &_GreenPrimaryX, &_GreenPrimaryY, &_BluePrimaryX, &_BluePrimaryY, &_WhitePointX, &_WhitePointY, &_MaxMasteringLuminance, &_MinMasteringLuminance, &_MaxContentLightLevel, &_MaxFrameAverageLightLevel))
        {
            return nullptr;
        }

        try
        {
            self->obj.RedPrimaryX = _RedPrimaryX;
            self->obj.RedPrimaryY = _RedPrimaryY;
            self->obj.GreenPrimaryX = _GreenPrimaryX;
            self->obj.GreenPrimaryY = _GreenPrimaryY;
            self->obj.BluePrimaryX = _BluePrimaryX;
            self->obj.BluePrimaryY = _BluePrimaryY;
            self->obj.WhitePointX = _WhitePointX;
            self->obj.WhitePointY = _WhitePointY;
            self->obj.MaxMasteringLuminance = _MaxMasteringLuminance;
            self->obj.MinMasteringLuminance = _MinMasteringLuminance;
            self->obj.MaxContentLightLevel = _MaxContentLightLevel;
            self->obj.MaxFrameAverageLightLevel = _MaxFrameAverageLightLevel;

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

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

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

    PyObject* _replace_HdmiDisplayHdr2086Metadata(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata* self, PyObject* args, PyObject* kwds) noexcept
    {
        try
        {
            uint16_t _RedPrimaryX{self->obj.RedPrimaryX};
            uint16_t _RedPrimaryY{self->obj.RedPrimaryY};
            uint16_t _GreenPrimaryX{self->obj.GreenPrimaryX};
            uint16_t _GreenPrimaryY{self->obj.GreenPrimaryY};
            uint16_t _BluePrimaryX{self->obj.BluePrimaryX};
            uint16_t _BluePrimaryY{self->obj.BluePrimaryY};
            uint16_t _WhitePointX{self->obj.WhitePointX};
            uint16_t _WhitePointY{self->obj.WhitePointY};
            uint16_t _MaxMasteringLuminance{self->obj.MaxMasteringLuminance};
            uint16_t _MinMasteringLuminance{self->obj.MinMasteringLuminance};
            uint16_t _MaxContentLightLevel{self->obj.MaxContentLightLevel};
            uint16_t _MaxFrameAverageLightLevel{self->obj.MaxFrameAverageLightLevel};

            static const char* kwlist[] = {"red_primary_x", "red_primary_y", "green_primary_x", "green_primary_y", "blue_primary_x", "blue_primary_y", "white_point_x", "white_point_y", "max_mastering_luminance", "min_mastering_luminance", "max_content_light_level", "max_frame_average_light_level", nullptr};
            if (!PyArg_ParseTupleAndKeywords(args, kwds, "|$HHHHHHHHHHHH", const_cast<char**>(kwlist), &_RedPrimaryX, &_RedPrimaryY, &_GreenPrimaryX, &_GreenPrimaryY, &_BluePrimaryX, &_BluePrimaryY, &_WhitePointX, &_WhitePointY, &_MaxMasteringLuminance, &_MinMasteringLuminance, &_MaxContentLightLevel, &_MaxFrameAverageLightLevel))
            {
                return nullptr;
            }

            auto copy = self->obj;
            copy.RedPrimaryX = _RedPrimaryX;
            copy.RedPrimaryY = _RedPrimaryY;
            copy.GreenPrimaryX = _GreenPrimaryX;
            copy.GreenPrimaryY = _GreenPrimaryY;
            copy.BluePrimaryX = _BluePrimaryX;
            copy.BluePrimaryY = _BluePrimaryY;
            copy.WhitePointX = _WhitePointX;
            copy.WhitePointY = _WhitePointY;
            copy.MaxMasteringLuminance = _MaxMasteringLuminance;
            copy.MinMasteringLuminance = _MinMasteringLuminance;
            copy.MaxContentLightLevel = _MaxContentLightLevel;
            copy.MaxFrameAverageLightLevel = _MaxFrameAverageLightLevel;

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

    PyObject* unpack_HdmiDisplayHdr2086Metadata(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata* self, PyObject* /*unused*/) noexcept
    {
        py::pyobj_handle RedPrimaryX{convert(self->obj.RedPrimaryX)};
        if (!RedPrimaryX)
        {
            return nullptr;
        }

        py::pyobj_handle RedPrimaryY{convert(self->obj.RedPrimaryY)};
        if (!RedPrimaryY)
        {
            return nullptr;
        }

        py::pyobj_handle GreenPrimaryX{convert(self->obj.GreenPrimaryX)};
        if (!GreenPrimaryX)
        {
            return nullptr;
        }

        py::pyobj_handle GreenPrimaryY{convert(self->obj.GreenPrimaryY)};
        if (!GreenPrimaryY)
        {
            return nullptr;
        }

        py::pyobj_handle BluePrimaryX{convert(self->obj.BluePrimaryX)};
        if (!BluePrimaryX)
        {
            return nullptr;
        }

        py::pyobj_handle BluePrimaryY{convert(self->obj.BluePrimaryY)};
        if (!BluePrimaryY)
        {
            return nullptr;
        }

        py::pyobj_handle WhitePointX{convert(self->obj.WhitePointX)};
        if (!WhitePointX)
        {
            return nullptr;
        }

        py::pyobj_handle WhitePointY{convert(self->obj.WhitePointY)};
        if (!WhitePointY)
        {
            return nullptr;
        }

        py::pyobj_handle MaxMasteringLuminance{convert(self->obj.MaxMasteringLuminance)};
        if (!MaxMasteringLuminance)
        {
            return nullptr;
        }

        py::pyobj_handle MinMasteringLuminance{convert(self->obj.MinMasteringLuminance)};
        if (!MinMasteringLuminance)
        {
            return nullptr;
        }

        py::pyobj_handle MaxContentLightLevel{convert(self->obj.MaxContentLightLevel)};
        if (!MaxContentLightLevel)
        {
            return nullptr;
        }

        py::pyobj_handle MaxFrameAverageLightLevel{convert(self->obj.MaxFrameAverageLightLevel)};
        if (!MaxFrameAverageLightLevel)
        {
            return nullptr;
        }

        pyobj_handle tuple{PyTuple_New(12)};
        if (!tuple)
        {
            return nullptr;
        }

        PyTuple_SET_ITEM(tuple.get(), 0, RedPrimaryX.detach());
        PyTuple_SET_ITEM(tuple.get(), 1, RedPrimaryY.detach());
        PyTuple_SET_ITEM(tuple.get(), 2, GreenPrimaryX.detach());
        PyTuple_SET_ITEM(tuple.get(), 3, GreenPrimaryY.detach());
        PyTuple_SET_ITEM(tuple.get(), 4, BluePrimaryX.detach());
        PyTuple_SET_ITEM(tuple.get(), 5, BluePrimaryY.detach());
        PyTuple_SET_ITEM(tuple.get(), 6, WhitePointX.detach());
        PyTuple_SET_ITEM(tuple.get(), 7, WhitePointY.detach());
        PyTuple_SET_ITEM(tuple.get(), 8, MaxMasteringLuminance.detach());
        PyTuple_SET_ITEM(tuple.get(), 9, MinMasteringLuminance.detach());
        PyTuple_SET_ITEM(tuple.get(), 10, MaxContentLightLevel.detach());
        PyTuple_SET_ITEM(tuple.get(), 11, MaxFrameAverageLightLevel.detach());

        return tuple.detach();
    }

    static PyMethodDef _methods_HdmiDisplayHdr2086Metadata[] = {
        { "_assign_array_", _assign_array_HdmiDisplayHdr2086Metadata, METH_O | METH_STATIC, nullptr },
        { "__replace__", reinterpret_cast<PyCFunction>(reinterpret_cast<void*>(_replace_HdmiDisplayHdr2086Metadata)), METH_VARARGS | METH_KEYWORDS, nullptr },
        { "unpack", reinterpret_cast<PyCFunction>(unpack_HdmiDisplayHdr2086Metadata), METH_NOARGS, nullptr },
        { }};

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

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

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

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

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

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

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

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

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

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

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

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

    static PyGetSetDef _getset_HdmiDisplayHdr2086Metadata[] = {
        { "red_primary_x", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_RedPrimaryX), nullptr, nullptr, nullptr },
        { "red_primary_y", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_RedPrimaryY), nullptr, nullptr, nullptr },
        { "green_primary_x", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_GreenPrimaryX), nullptr, nullptr, nullptr },
        { "green_primary_y", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_GreenPrimaryY), nullptr, nullptr, nullptr },
        { "blue_primary_x", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_BluePrimaryX), nullptr, nullptr, nullptr },
        { "blue_primary_y", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_BluePrimaryY), nullptr, nullptr, nullptr },
        { "white_point_x", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_WhitePointX), nullptr, nullptr, nullptr },
        { "white_point_y", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_WhitePointY), nullptr, nullptr, nullptr },
        { "max_mastering_luminance", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_MaxMasteringLuminance), nullptr, nullptr, nullptr },
        { "min_mastering_luminance", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_MinMasteringLuminance), nullptr, nullptr, nullptr },
        { "max_content_light_level", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_MaxContentLightLevel), nullptr, nullptr, nullptr },
        { "max_frame_average_light_level", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_MaxFrameAverageLightLevel), nullptr, nullptr, nullptr },
        { }};

    static PyObject* _richcompare_HdmiDisplayHdr2086Metadata(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata* self, PyObject* other, int op) noexcept
    {
        try
        {
            auto _other = py::convert_to<winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata>(other);

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

                Py_RETURN_FALSE;
            }

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

                Py_RETURN_FALSE;
            }

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

    static PyObject* _repr_HdmiDisplayHdr2086Metadata(PyObject* self) noexcept
    {
        py::pyobj_handle RedPrimaryX{PyObject_GetAttrString(self, "red_primary_x")};
        if (!RedPrimaryX)
        {
            return nullptr;
        }

        py::pyobj_handle RedPrimaryY{PyObject_GetAttrString(self, "red_primary_y")};
        if (!RedPrimaryY)
        {
            return nullptr;
        }

        py::pyobj_handle GreenPrimaryX{PyObject_GetAttrString(self, "green_primary_x")};
        if (!GreenPrimaryX)
        {
            return nullptr;
        }

        py::pyobj_handle GreenPrimaryY{PyObject_GetAttrString(self, "green_primary_y")};
        if (!GreenPrimaryY)
        {
            return nullptr;
        }

        py::pyobj_handle BluePrimaryX{PyObject_GetAttrString(self, "blue_primary_x")};
        if (!BluePrimaryX)
        {
            return nullptr;
        }

        py::pyobj_handle BluePrimaryY{PyObject_GetAttrString(self, "blue_primary_y")};
        if (!BluePrimaryY)
        {
            return nullptr;
        }

        py::pyobj_handle WhitePointX{PyObject_GetAttrString(self, "white_point_x")};
        if (!WhitePointX)
        {
            return nullptr;
        }

        py::pyobj_handle WhitePointY{PyObject_GetAttrString(self, "white_point_y")};
        if (!WhitePointY)
        {
            return nullptr;
        }

        py::pyobj_handle MaxMasteringLuminance{PyObject_GetAttrString(self, "max_mastering_luminance")};
        if (!MaxMasteringLuminance)
        {
            return nullptr;
        }

        py::pyobj_handle MinMasteringLuminance{PyObject_GetAttrString(self, "min_mastering_luminance")};
        if (!MinMasteringLuminance)
        {
            return nullptr;
        }

        py::pyobj_handle MaxContentLightLevel{PyObject_GetAttrString(self, "max_content_light_level")};
        if (!MaxContentLightLevel)
        {
            return nullptr;
        }

        py::pyobj_handle MaxFrameAverageLightLevel{PyObject_GetAttrString(self, "max_frame_average_light_level")};
        if (!MaxFrameAverageLightLevel)
        {
            return nullptr;
        }

        return PyUnicode_FromFormat("HdmiDisplayHdr2086Metadata(red_primary_x=%R, red_primary_y=%R, green_primary_x=%R, green_primary_y=%R, blue_primary_x=%R, blue_primary_y=%R, white_point_x=%R, white_point_y=%R, max_mastering_luminance=%R, min_mastering_luminance=%R, max_content_light_level=%R, max_frame_average_light_level=%R)", RedPrimaryX.get(), RedPrimaryY.get(), GreenPrimaryX.get(), GreenPrimaryY.get(), BluePrimaryX.get(), BluePrimaryY.get(), WhitePointX.get(), WhitePointY.get(), MaxMasteringLuminance.get(), MinMasteringLuminance.get(), MaxContentLightLevel.get(), MaxFrameAverageLightLevel.get());
    }

    static PyType_Slot _type_slots_HdmiDisplayHdr2086Metadata[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_HdmiDisplayHdr2086Metadata) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_HdmiDisplayHdr2086Metadata) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_HdmiDisplayHdr2086Metadata) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_HdmiDisplayHdr2086Metadata) },
        { Py_tp_richcompare, reinterpret_cast<void*>(_richcompare_HdmiDisplayHdr2086Metadata) },
        { Py_tp_repr, reinterpret_cast<void*>(_repr_HdmiDisplayHdr2086Metadata) },
        { }};

    static PyType_Spec type_spec_HdmiDisplayHdr2086Metadata = {
        "winrt._winrt_windows_graphics_display_core.HdmiDisplayHdr2086Metadata",
        sizeof(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_HdmiDisplayHdr2086Metadata};

    // ----- Windows.Graphics.Display.Core Initialization --------------------

    PyDoc_STRVAR(module_doc, "Windows.Graphics.Display.Core");

    static PyModuleDef module_def = {
        PyModuleDef_HEAD_INIT,
        "_winrt_windows_graphics_display_core",
        module_doc,
        0,
        nullptr,
        nullptr,
        nullptr,
        nullptr,
        nullptr};
} // py::cpp::Windows::Graphics::Display::Core

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

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

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

    if (!module)
    {
        return nullptr;
    }

    auto inspectable_meta_type = py::get_inspectable_meta_type();
    if (!inspectable_meta_type)
    {
        return nullptr;
    }

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

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

    if (!object_bases)
    {
        return nullptr;
    }

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

    py::pyobj_handle type_HdmiDisplayInformation_Static{PyType_FromSpecWithBases(&type_spec_HdmiDisplayInformation_Static, HdmiDisplayInformation_Static_bases.get())};
    if (!type_HdmiDisplayInformation_Static)
    {
        return nullptr;
    }

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

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

    py::pytype_handle HdmiDisplayHdr2086Metadata_type{py::register_python_type(module.get(), &type_spec_HdmiDisplayHdr2086Metadata, nullptr, nullptr)};
    if (!HdmiDisplayHdr2086Metadata_type)
    {
        return nullptr;
    }

    py::pyobj_handle HdmiDisplayHdr2086Metadata_from_tuple_capsule{PyCapsule_New(reinterpret_cast<void*>(HdmiDisplayHdr2086Metadata_from_tuple),"winrt._winrt_windows_graphics_display_core.HdmiDisplayHdr2086Metadata_from_tuple", nullptr)};
    if (!HdmiDisplayHdr2086Metadata_from_tuple_capsule)
    {
        return nullptr;
    }

    if (PyModule_AddObjectRef(module.get(), "HdmiDisplayHdr2086Metadata_from_tuple", HdmiDisplayHdr2086Metadata_from_tuple_capsule.get()) == -1)
    {
        return nullptr;
    }

    return module.detach();
}
