// WARNING: Please don't edit this file. It was generated by Python/WinRT v1.0.0-beta.9

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


PyObject* py::converter<winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata>::convert(winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata instance) noexcept
{
    auto type = py::get_python_type<winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata>();
    if (!type)
    {
        return nullptr;
    }

    return py::wrap_struct(instance, type);
}
winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata py::converter<winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata>::convert_to(PyObject* obj)
{
    throw_if_pyobj_null(obj);

    auto type =  py::get_python_type<winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata>();

    if (!type) {
        throw python_exception();
    }

    if (Py_TYPE(obj) == type)
    {
        return reinterpret_cast<py::winrt_struct_wrapper<winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata>*>(obj)->obj;
    }

    PyErr_SetString(PyExc_TypeError, "expecting winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata");
    throw python_exception();
}

namespace py::cpp::Windows::Graphics::Display::Core
{
    struct module_state
    {
        PyObject* type_HdmiDisplayColorSpace;
        PyObject* type_HdmiDisplayHdrOption;
        PyObject* type_HdmiDisplayPixelEncoding;
        PyTypeObject* type_HdmiDisplayInformation;
        PyTypeObject* type_HdmiDisplayMode;
        PyTypeObject* type_HdmiDisplayHdr2086Metadata;
    };

    static PyObject* register_HdmiDisplayColorSpace(PyObject* module, PyObject* type) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
        assert(state);

        if (state->type_HdmiDisplayColorSpace)
        {
            PyErr_SetString(PyExc_RuntimeError, "type has already been registered");
            return nullptr;
        }

        if (!PyType_Check(type))
        {
            PyErr_SetString(PyExc_TypeError, "argument is not a type");
            return nullptr;
        }

        state->type_HdmiDisplayColorSpace = type;
        Py_INCREF(state->type_HdmiDisplayColorSpace);


        Py_RETURN_NONE;
    }

    static PyObject* register_HdmiDisplayHdrOption(PyObject* module, PyObject* type) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
        assert(state);

        if (state->type_HdmiDisplayHdrOption)
        {
            PyErr_SetString(PyExc_RuntimeError, "type has already been registered");
            return nullptr;
        }

        if (!PyType_Check(type))
        {
            PyErr_SetString(PyExc_TypeError, "argument is not a type");
            return nullptr;
        }

        state->type_HdmiDisplayHdrOption = type;
        Py_INCREF(state->type_HdmiDisplayHdrOption);


        Py_RETURN_NONE;
    }

    static PyObject* register_HdmiDisplayPixelEncoding(PyObject* module, PyObject* type) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
        assert(state);

        if (state->type_HdmiDisplayPixelEncoding)
        {
            PyErr_SetString(PyExc_RuntimeError, "type has already been registered");
            return nullptr;
        }

        if (!PyType_Check(type))
        {
            PyErr_SetString(PyExc_TypeError, "argument is not a type");
            return nullptr;
        }

        state->type_HdmiDisplayPixelEncoding = type;
        Py_INCREF(state->type_HdmiDisplayPixelEncoding);


        Py_RETURN_NONE;
    }

    // ----- HdmiDisplayInformation class --------------------
    static constexpr const char* const type_name_HdmiDisplayInformation = "HdmiDisplayInformation";

    static PyObject* _new_HdmiDisplayInformation(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_HdmiDisplayInformation);
        return nullptr;
    }

    static void _dealloc_HdmiDisplayInformation(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayInformation* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(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_Size(args);

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

            try
            {
                return py::convert(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_Size(args);

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

            try
            {
                return py::convert(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_Size(args);

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

            try
            {
                return py::convert(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_Size(args);

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

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

                return py::convert(self->obj.RequestSetCurrentDisplayModeAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.Core.HdmiDisplayInformation", L"RequestSetCurrentDisplayModeAsync", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                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(self->obj.RequestSetCurrentDisplayModeAsync(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 3)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Display.Core.HdmiDisplayInformation", L"RequestSetCurrentDisplayModeAsync", 3))
            {
                py::set_arg_count_version_error(3);
                return nullptr;
            }

            try
            {
                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(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_SetDefaultDisplayModeAsync(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayInformation* 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.Core.HdmiDisplayInformation", L"SetDefaultDisplayModeAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(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
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.Core.HdmiDisplayInformation", L"DisplayModesChanged"))
        {
            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::Core::HdmiDisplayInformation, winrt::Windows::Foundation::IInspectable>>(arg);

            return py::convert(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
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Display.Core.HdmiDisplayInformation", L"DisplayModesChanged"))
        {
            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.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_for_current_view", reinterpret_cast<PyCFunction>(HdmiDisplayInformation_GetForCurrentView), METH_VARARGS | METH_STATIC, 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 },
        { "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 =
    {
        "_winsdk_Windows_Graphics_Display_Core.HdmiDisplayInformation",
        sizeof(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayInformation),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_HdmiDisplayInformation
    };

    // ----- HdmiDisplayMode class --------------------
    static constexpr const char* const type_name_HdmiDisplayMode = "HdmiDisplayMode";

    static PyObject* _new_HdmiDisplayMode(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_HdmiDisplayMode);
        return nullptr;
    }

    static void _dealloc_HdmiDisplayMode(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayMode* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(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_Size(args);

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

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

                return py::convert(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
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"BitsPerPixel"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(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
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"ColorSpace"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(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
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"Is2086MetadataSupported"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(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
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"IsSdrLuminanceSupported"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(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
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"IsSmpte2084Supported"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(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
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"PixelEncoding"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(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
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"RefreshRate"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(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
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"ResolutionHeightInRawPixels"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(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
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"ResolutionWidthInRawPixels"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(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
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", 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* HdmiDisplayMode_get_IsDolbyVisionLowLatencySupported(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayMode* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Display.Core.HdmiDisplayMode", L"IsDolbyVisionLowLatencySupported"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(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 =
    {
        "_winsdk_Windows_Graphics_Display_Core.HdmiDisplayMode",
        sizeof(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayMode),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_HdmiDisplayMode
    };

    // ----- HdmiDisplayHdr2086Metadata struct --------------------
    static constexpr const char* const type_name_HdmiDisplayHdr2086Metadata = "HdmiDisplayHdr2086Metadata";

    PyObject* _new_HdmiDisplayHdr2086Metadata(PyTypeObject* type, PyObject* args, PyObject* kwds)
    {
        auto tuple_size = PyTuple_Size(args);

        if ((tuple_size == 0) && (kwds == nullptr))
        {
            try
            {
                winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata return_value{};
                return py::convert(return_value);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }

        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
        {
            winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata return_value{ _RedPrimaryX, _RedPrimaryY, _GreenPrimaryX, _GreenPrimaryY, _BluePrimaryX, _BluePrimaryY, _WhitePointX, _WhitePointY, _MaxMasteringLuminance, _MinMasteringLuminance, _MaxContentLightLevel, _MaxFrameAverageLightLevel };
            return py::convert(return_value);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static void _dealloc_HdmiDisplayHdr2086Metadata(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata* self) noexcept
    {
    }

    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 int HdmiDisplayHdr2086Metadata_set_RedPrimaryX(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

    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 int HdmiDisplayHdr2086Metadata_set_RedPrimaryY(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

    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 int HdmiDisplayHdr2086Metadata_set_GreenPrimaryX(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

    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 int HdmiDisplayHdr2086Metadata_set_GreenPrimaryY(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

    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 int HdmiDisplayHdr2086Metadata_set_BluePrimaryX(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

    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 int HdmiDisplayHdr2086Metadata_set_BluePrimaryY(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

    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 int HdmiDisplayHdr2086Metadata_set_WhitePointX(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

    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 int HdmiDisplayHdr2086Metadata_set_WhitePointY(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

    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 int HdmiDisplayHdr2086Metadata_set_MaxMasteringLuminance(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

    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 int HdmiDisplayHdr2086Metadata_set_MinMasteringLuminance(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

    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 int HdmiDisplayHdr2086Metadata_set_MaxContentLightLevel(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

    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 int HdmiDisplayHdr2086Metadata_set_MaxFrameAverageLightLevel(py::wrapper::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

    static PyGetSetDef _getset_HdmiDisplayHdr2086Metadata[] = {
        { "red_primary_x", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_RedPrimaryX), reinterpret_cast<setter>(HdmiDisplayHdr2086Metadata_set_RedPrimaryX), nullptr, nullptr },
        { "red_primary_y", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_RedPrimaryY), reinterpret_cast<setter>(HdmiDisplayHdr2086Metadata_set_RedPrimaryY), nullptr, nullptr },
        { "green_primary_x", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_GreenPrimaryX), reinterpret_cast<setter>(HdmiDisplayHdr2086Metadata_set_GreenPrimaryX), nullptr, nullptr },
        { "green_primary_y", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_GreenPrimaryY), reinterpret_cast<setter>(HdmiDisplayHdr2086Metadata_set_GreenPrimaryY), nullptr, nullptr },
        { "blue_primary_x", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_BluePrimaryX), reinterpret_cast<setter>(HdmiDisplayHdr2086Metadata_set_BluePrimaryX), nullptr, nullptr },
        { "blue_primary_y", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_BluePrimaryY), reinterpret_cast<setter>(HdmiDisplayHdr2086Metadata_set_BluePrimaryY), nullptr, nullptr },
        { "white_point_x", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_WhitePointX), reinterpret_cast<setter>(HdmiDisplayHdr2086Metadata_set_WhitePointX), nullptr, nullptr },
        { "white_point_y", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_WhitePointY), reinterpret_cast<setter>(HdmiDisplayHdr2086Metadata_set_WhitePointY), nullptr, nullptr },
        { "max_mastering_luminance", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_MaxMasteringLuminance), reinterpret_cast<setter>(HdmiDisplayHdr2086Metadata_set_MaxMasteringLuminance), nullptr, nullptr },
        { "min_mastering_luminance", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_MinMasteringLuminance), reinterpret_cast<setter>(HdmiDisplayHdr2086Metadata_set_MinMasteringLuminance), nullptr, nullptr },
        { "max_content_light_level", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_MaxContentLightLevel), reinterpret_cast<setter>(HdmiDisplayHdr2086Metadata_set_MaxContentLightLevel), nullptr, nullptr },
        { "max_frame_average_light_level", reinterpret_cast<getter>(HdmiDisplayHdr2086Metadata_get_MaxFrameAverageLightLevel), reinterpret_cast<setter>(HdmiDisplayHdr2086Metadata_set_MaxFrameAverageLightLevel), nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_HdmiDisplayHdr2086Metadata[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_HdmiDisplayHdr2086Metadata) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_HdmiDisplayHdr2086Metadata) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_HdmiDisplayHdr2086Metadata) },
        { },
    };

    static PyType_Spec type_spec_HdmiDisplayHdr2086Metadata =
    {
        "_winsdk_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 PyMethodDef module_methods[] = {
        {"_register_HdmiDisplayColorSpace", register_HdmiDisplayColorSpace, METH_O, "registers type"},
        {"_register_HdmiDisplayHdrOption", register_HdmiDisplayHdrOption, METH_O, "registers type"},
        {"_register_HdmiDisplayPixelEncoding", register_HdmiDisplayPixelEncoding, METH_O, "registers type"},
        {}};


    static int module_traverse(PyObject* module, visitproc visit, void* arg) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));

        if (!state)
        {
            return 0;
        }

        Py_VISIT(state->type_HdmiDisplayColorSpace);
        Py_VISIT(state->type_HdmiDisplayHdrOption);
        Py_VISIT(state->type_HdmiDisplayPixelEncoding);
        Py_VISIT(state->type_HdmiDisplayInformation);
        Py_VISIT(state->type_HdmiDisplayMode);
        Py_VISIT(state->type_HdmiDisplayHdr2086Metadata);

        return 0;
    }

    static int module_clear(PyObject* module) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));

        if (!state)
        {
            return 0;
        }

        Py_CLEAR(state->type_HdmiDisplayColorSpace);
        Py_CLEAR(state->type_HdmiDisplayHdrOption);
        Py_CLEAR(state->type_HdmiDisplayPixelEncoding);
        Py_CLEAR(state->type_HdmiDisplayInformation);
        Py_CLEAR(state->type_HdmiDisplayMode);
        Py_CLEAR(state->type_HdmiDisplayHdr2086Metadata);

        return 0;
    }


    static PyModuleDef module_def
        = {PyModuleDef_HEAD_INIT,
           "_winsdk_Windows_Graphics_Display_Core",
           module_doc,
           sizeof(module_state),
           module_methods,
           nullptr,
           module_traverse,
           module_clear,
           nullptr};

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

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

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

    if (!module)
    {
        return nullptr;
    }

    auto object_type = py::get_python_type<py::Object>();
    if (!object_type)
    {
        return nullptr;
    }

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

    if (!bases)
    {
        return nullptr;
    }

    py::pyobj_handle collections_abc_module{PyImport_ImportModule("collections.abc")};

    if (!collections_abc_module)
    {
        return nullptr;
    }

    py::pyobj_handle sequence_type{PyObject_GetAttrString(collections_abc_module.get(), "Sequence")};

    if (!sequence_type)
    {
        return nullptr;
    }

    py::pyobj_handle sequence_bases{PyTuple_Pack(2, object_type, sequence_type.get())};

    if (!sequence_bases)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_sequence_type{PyObject_GetAttrString(collections_abc_module.get(), "MutableSequence")};

    if (!mutable_sequence_type)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_sequence_bases{PyTuple_Pack(2, object_type, mutable_sequence_type.get())};

    if (!mutable_sequence_bases)
    {
        return nullptr;
    }

    py::pyobj_handle mapping_type{PyObject_GetAttrString(collections_abc_module.get(), "Mapping")};

    if (!mapping_type)
    {
        return nullptr;
    }

    py::pyobj_handle mapping_bases{PyTuple_Pack(2, object_type, mapping_type.get())};

    if (!mapping_bases)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_mapping_type{PyObject_GetAttrString(collections_abc_module.get(), "MutableMapping")};

    if (!mutable_mapping_type)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_mapping_bases{PyTuple_Pack(2, object_type, mutable_mapping_type.get())};

    if (!mutable_mapping_bases)
    {
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module.get()));
    assert(state);

    state->type_HdmiDisplayInformation = py::register_python_type(module.get(), type_name_HdmiDisplayInformation, &type_spec_HdmiDisplayInformation, bases.get(), nullptr);
    if (!state->type_HdmiDisplayInformation)
    {
        return nullptr;
    }

    state->type_HdmiDisplayMode = py::register_python_type(module.get(), type_name_HdmiDisplayMode, &type_spec_HdmiDisplayMode, bases.get(), nullptr);
    if (!state->type_HdmiDisplayMode)
    {
        return nullptr;
    }

    state->type_HdmiDisplayHdr2086Metadata = py::register_python_type(module.get(), type_name_HdmiDisplayHdr2086Metadata, &type_spec_HdmiDisplayHdr2086Metadata, bases.get(), nullptr);
    if (!state->type_HdmiDisplayHdr2086Metadata)
    {
        return nullptr;
    }


    return module.detach();
}

PyObject* py::py_type<winrt::Windows::Graphics::Display::Core::HdmiDisplayColorSpace>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Graphics::Display::Core;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Graphics::Display::Core");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_HdmiDisplayColorSpace;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Graphics::Display::Core::HdmiDisplayColorSpace is not registered");
        return nullptr;
    }

    return python_type;
}

PyObject* py::py_type<winrt::Windows::Graphics::Display::Core::HdmiDisplayHdrOption>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Graphics::Display::Core;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Graphics::Display::Core");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_HdmiDisplayHdrOption;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Graphics::Display::Core::HdmiDisplayHdrOption is not registered");
        return nullptr;
    }

    return python_type;
}

PyObject* py::py_type<winrt::Windows::Graphics::Display::Core::HdmiDisplayPixelEncoding>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Graphics::Display::Core;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Graphics::Display::Core");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_HdmiDisplayPixelEncoding;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Graphics::Display::Core::HdmiDisplayPixelEncoding is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Graphics::Display::Core::HdmiDisplayInformation>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Graphics::Display::Core;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Graphics::Display::Core");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_HdmiDisplayInformation;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Graphics::Display::Core::HdmiDisplayInformation is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Graphics::Display::Core::HdmiDisplayMode>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Graphics::Display::Core;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Graphics::Display::Core");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_HdmiDisplayMode;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Graphics::Display::Core::HdmiDisplayMode is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Graphics::Display::Core;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Graphics::Display::Core");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_HdmiDisplayHdr2086Metadata;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata is not registered");
        return nullptr;
    }

    return python_type;
}
