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

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

PyTypeObject* py::winrt_type<winrt::Windows::Graphics::Display::Core::HdmiDisplayInformation>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Graphics::Display::Core::HdmiDisplayMode>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata>::python_type;

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

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

    if (!PyDict_Check(obj))
    {
        throw winrt::hresult_invalid_argument();
    }

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

    PyObject* py_RedPrimaryX = PyDict_GetItemString(obj, "red_primary_x");
    if (!py_RedPrimaryX) { throw winrt::hresult_invalid_argument(); }
    return_value.RedPrimaryX = converter<uint16_t>::convert_to(py_RedPrimaryX);

    PyObject* py_RedPrimaryY = PyDict_GetItemString(obj, "red_primary_y");
    if (!py_RedPrimaryY) { throw winrt::hresult_invalid_argument(); }
    return_value.RedPrimaryY = converter<uint16_t>::convert_to(py_RedPrimaryY);

    PyObject* py_GreenPrimaryX = PyDict_GetItemString(obj, "green_primary_x");
    if (!py_GreenPrimaryX) { throw winrt::hresult_invalid_argument(); }
    return_value.GreenPrimaryX = converter<uint16_t>::convert_to(py_GreenPrimaryX);

    PyObject* py_GreenPrimaryY = PyDict_GetItemString(obj, "green_primary_y");
    if (!py_GreenPrimaryY) { throw winrt::hresult_invalid_argument(); }
    return_value.GreenPrimaryY = converter<uint16_t>::convert_to(py_GreenPrimaryY);

    PyObject* py_BluePrimaryX = PyDict_GetItemString(obj, "blue_primary_x");
    if (!py_BluePrimaryX) { throw winrt::hresult_invalid_argument(); }
    return_value.BluePrimaryX = converter<uint16_t>::convert_to(py_BluePrimaryX);

    PyObject* py_BluePrimaryY = PyDict_GetItemString(obj, "blue_primary_y");
    if (!py_BluePrimaryY) { throw winrt::hresult_invalid_argument(); }
    return_value.BluePrimaryY = converter<uint16_t>::convert_to(py_BluePrimaryY);

    PyObject* py_WhitePointX = PyDict_GetItemString(obj, "white_point_x");
    if (!py_WhitePointX) { throw winrt::hresult_invalid_argument(); }
    return_value.WhitePointX = converter<uint16_t>::convert_to(py_WhitePointX);

    PyObject* py_WhitePointY = PyDict_GetItemString(obj, "white_point_y");
    if (!py_WhitePointY) { throw winrt::hresult_invalid_argument(); }
    return_value.WhitePointY = converter<uint16_t>::convert_to(py_WhitePointY);

    PyObject* py_MaxMasteringLuminance = PyDict_GetItemString(obj, "max_mastering_luminance");
    if (!py_MaxMasteringLuminance) { throw winrt::hresult_invalid_argument(); }
    return_value.MaxMasteringLuminance = converter<uint16_t>::convert_to(py_MaxMasteringLuminance);

    PyObject* py_MinMasteringLuminance = PyDict_GetItemString(obj, "min_mastering_luminance");
    if (!py_MinMasteringLuminance) { throw winrt::hresult_invalid_argument(); }
    return_value.MinMasteringLuminance = converter<uint16_t>::convert_to(py_MinMasteringLuminance);

    PyObject* py_MaxContentLightLevel = PyDict_GetItemString(obj, "max_content_light_level");
    if (!py_MaxContentLightLevel) { throw winrt::hresult_invalid_argument(); }
    return_value.MaxContentLightLevel = converter<uint16_t>::convert_to(py_MaxContentLightLevel);

    PyObject* py_MaxFrameAverageLightLevel = PyDict_GetItemString(obj, "max_frame_average_light_level");
    if (!py_MaxFrameAverageLightLevel) { throw winrt::hresult_invalid_argument(); }
    return_value.MaxFrameAverageLightLevel = converter<uint16_t>::convert_to(py_MaxFrameAverageLightLevel);

    return return_value;
}

namespace py::cpp::Windows::Graphics::Display::Core
{
    // ----- HdmiDisplayInformation class --------------------
    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)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

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

        if (arg_count == 0)
        {
            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
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            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
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            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
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            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)
        {
            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)
        {
            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
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            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
    {
        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
    {
        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* _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 },
        { "_from", reinterpret_cast<PyCFunction>(_from_HdmiDisplayInformation), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_HdmiDisplayInformation[] = {
        { }
    };

    static PyType_Slot _type_slots_HdmiDisplayInformation[] = 
    {
        { Py_tp_new, _new_HdmiDisplayInformation },
        { Py_tp_dealloc, _dealloc_HdmiDisplayInformation },
        { Py_tp_methods, _methods_HdmiDisplayInformation },
        { Py_tp_getset, _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 --------------------
    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)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

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

        if (arg_count == 1)
        {
            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
    {
        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
    {
        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
    {
        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
    {
        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
    {
        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
    {
        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
    {
        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
    {
        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
    {
        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
    {
        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
    {
        try
        {
            return py::convert(self->obj.IsDolbyVisionLowLatencySupported());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    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 },
        { "_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, _new_HdmiDisplayMode },
        { Py_tp_dealloc, _dealloc_HdmiDisplayMode },
        { Py_tp_methods, _methods_HdmiDisplayMode },
        { Py_tp_getset, _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 --------------------
    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;
            }
        }

        if ((tuple_size == 1) && (kwds == nullptr))
        {
            auto arg = PyTuple_GetItem(args, 0);
            if (PyDict_Check(arg))
            {
                try
                {
                    auto return_value = py::convert_to<winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata>(arg);
                    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)
    {
    }

    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_TypeError, "property delete not supported");
            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_TypeError, "property delete not supported");
            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_TypeError, "property delete not supported");
            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_TypeError, "property delete not supported");
            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_TypeError, "property delete not supported");
            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_TypeError, "property delete not supported");
            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_TypeError, "property delete not supported");
            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_TypeError, "property delete not supported");
            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_TypeError, "property delete not supported");
            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_TypeError, "property delete not supported");
            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_TypeError, "property delete not supported");
            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_TypeError, "property delete not supported");
            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, _new_HdmiDisplayHdr2086Metadata },
        { Py_tp_dealloc, _dealloc_HdmiDisplayHdr2086Metadata },
        { Py_tp_getset, _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 --------------------
    static int module_exec(PyObject* module) noexcept
    {
        try
        {
            py::pyobj_handle bases { PyTuple_Pack(1, py::winrt_type<py::Object>::python_type) };

            py::winrt_type<winrt::Windows::Graphics::Display::Core::HdmiDisplayInformation>::python_type = py::register_python_type(module, _type_name_HdmiDisplayInformation, &_type_spec_HdmiDisplayInformation, bases.get());
            py::winrt_type<winrt::Windows::Graphics::Display::Core::HdmiDisplayMode>::python_type = py::register_python_type(module, _type_name_HdmiDisplayMode, &_type_spec_HdmiDisplayMode, bases.get());
            py::winrt_type<winrt::Windows::Graphics::Display::Core::HdmiDisplayHdr2086Metadata>::python_type = py::register_python_type(module, _type_name_HdmiDisplayHdr2086Metadata, &_type_spec_HdmiDisplayHdr2086Metadata, bases.get());

            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyModuleDef_Slot module_slots[] = {{Py_mod_exec, module_exec}, {}};

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

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

PyMODINIT_FUNC
PyInit__winsdk_Windows_Graphics_Display_Core (void) noexcept
{
    return PyModuleDef_Init(&py::cpp::Windows::Graphics::Display::Core::module_def);
}
