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

#include "py.Windows.Media.ClosedCaptioning.h"


namespace py::cpp::Windows::Media::ClosedCaptioning
{
    // ----- ClosedCaptionProperties class --------------------

    static PyObject* _new_ClosedCaptionProperties(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Media::ClosedCaptioning::ClosedCaptionProperties>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Media::ClosedCaptioning::ClosedCaptionProperties>::type_name);
        return nullptr;
    }

    static PyObject* ClosedCaptionProperties_get_BackgroundColor(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.ClosedCaptioning.ClosedCaptionProperties", L"BackgroundColor"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Media::ClosedCaptioning::ClosedCaptionProperties::BackgroundColor());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* ClosedCaptionProperties_get_BackgroundOpacity(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.ClosedCaptioning.ClosedCaptionProperties", L"BackgroundOpacity"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Media::ClosedCaptioning::ClosedCaptionProperties::BackgroundOpacity());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* ClosedCaptionProperties_get_ComputedBackgroundColor(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.ClosedCaptioning.ClosedCaptionProperties", L"ComputedBackgroundColor"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Media::ClosedCaptioning::ClosedCaptionProperties::ComputedBackgroundColor());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* ClosedCaptionProperties_get_ComputedFontColor(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.ClosedCaptioning.ClosedCaptionProperties", L"ComputedFontColor"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Media::ClosedCaptioning::ClosedCaptionProperties::ComputedFontColor());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* ClosedCaptionProperties_get_ComputedRegionColor(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.ClosedCaptioning.ClosedCaptionProperties", L"ComputedRegionColor"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Media::ClosedCaptioning::ClosedCaptionProperties::ComputedRegionColor());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* ClosedCaptionProperties_get_FontColor(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.ClosedCaptioning.ClosedCaptionProperties", L"FontColor"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Media::ClosedCaptioning::ClosedCaptionProperties::FontColor());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* ClosedCaptionProperties_get_FontEffect(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.ClosedCaptioning.ClosedCaptionProperties", L"FontEffect"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Media::ClosedCaptioning::ClosedCaptionProperties::FontEffect());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* ClosedCaptionProperties_get_FontOpacity(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.ClosedCaptioning.ClosedCaptionProperties", L"FontOpacity"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Media::ClosedCaptioning::ClosedCaptionProperties::FontOpacity());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* ClosedCaptionProperties_get_FontSize(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.ClosedCaptioning.ClosedCaptionProperties", L"FontSize"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Media::ClosedCaptioning::ClosedCaptionProperties::FontSize());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* ClosedCaptionProperties_get_FontStyle(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.ClosedCaptioning.ClosedCaptionProperties", L"FontStyle"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Media::ClosedCaptioning::ClosedCaptionProperties::FontStyle());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* ClosedCaptionProperties_get_RegionColor(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.ClosedCaptioning.ClosedCaptionProperties", L"RegionColor"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Media::ClosedCaptioning::ClosedCaptionProperties::RegionColor());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* ClosedCaptionProperties_get_RegionOpacity(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.ClosedCaptioning.ClosedCaptionProperties", L"RegionOpacity"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Media::ClosedCaptioning::ClosedCaptionProperties::RegionOpacity());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* ClosedCaptionProperties_add_PropertiesChanged(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Media.ClosedCaptioning.ClosedCaptionProperties", L"PropertiesChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable>>(arg);

            return py::convert(winrt::Windows::Media::ClosedCaptioning::ClosedCaptionProperties::PropertiesChanged(param0));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* ClosedCaptionProperties_remove_PropertiesChanged(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Media.ClosedCaptioning.ClosedCaptionProperties", L"PropertiesChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            winrt::Windows::Media::ClosedCaptioning::ClosedCaptionProperties::PropertiesChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_ClosedCaptionProperties[] = {
        { "add_properties_changed", reinterpret_cast<PyCFunction>(ClosedCaptionProperties_add_PropertiesChanged), METH_O | METH_STATIC, nullptr },
        { "remove_properties_changed", reinterpret_cast<PyCFunction>(ClosedCaptionProperties_remove_PropertiesChanged), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_ClosedCaptionProperties[] = {
        { }
    };

    static PyType_Slot _type_slots_ClosedCaptionProperties[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_ClosedCaptionProperties) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_ClosedCaptionProperties) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_ClosedCaptionProperties) },
        { },
    };

    static PyType_Spec type_spec_ClosedCaptionProperties =
    {
        "winrt._winrt_windows_media_closedcaptioning.ClosedCaptionProperties",
        0,
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_ClosedCaptionProperties
    };

    static PyGetSetDef getset_ClosedCaptionProperties_Static[] = {
        { "background_color", reinterpret_cast<getter>(ClosedCaptionProperties_get_BackgroundColor), nullptr, nullptr, nullptr },
        { "background_opacity", reinterpret_cast<getter>(ClosedCaptionProperties_get_BackgroundOpacity), nullptr, nullptr, nullptr },
        { "computed_background_color", reinterpret_cast<getter>(ClosedCaptionProperties_get_ComputedBackgroundColor), nullptr, nullptr, nullptr },
        { "computed_font_color", reinterpret_cast<getter>(ClosedCaptionProperties_get_ComputedFontColor), nullptr, nullptr, nullptr },
        { "computed_region_color", reinterpret_cast<getter>(ClosedCaptionProperties_get_ComputedRegionColor), nullptr, nullptr, nullptr },
        { "font_color", reinterpret_cast<getter>(ClosedCaptionProperties_get_FontColor), nullptr, nullptr, nullptr },
        { "font_effect", reinterpret_cast<getter>(ClosedCaptionProperties_get_FontEffect), nullptr, nullptr, nullptr },
        { "font_opacity", reinterpret_cast<getter>(ClosedCaptionProperties_get_FontOpacity), nullptr, nullptr, nullptr },
        { "font_size", reinterpret_cast<getter>(ClosedCaptionProperties_get_FontSize), nullptr, nullptr, nullptr },
        { "font_style", reinterpret_cast<getter>(ClosedCaptionProperties_get_FontStyle), nullptr, nullptr, nullptr },
        { "region_color", reinterpret_cast<getter>(ClosedCaptionProperties_get_RegionColor), nullptr, nullptr, nullptr },
        { "region_opacity", reinterpret_cast<getter>(ClosedCaptionProperties_get_RegionOpacity), nullptr, nullptr, nullptr },
        { }
    };

    static PyMethodDef methods_ClosedCaptionProperties_Static[] = {
        { }
    };

    static PyType_Slot type_slots_ClosedCaptionProperties_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_ClosedCaptionProperties_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_ClosedCaptionProperties_Static) },
        { }
    };

    static PyType_Spec type_spec_ClosedCaptionProperties_Static =
    {
        "winrt._winrt_windows_media_closedcaptioning.ClosedCaptionProperties_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_ClosedCaptionProperties_Static
    };

    // ----- Windows.Media.ClosedCaptioning Initialization --------------------
    PyDoc_STRVAR(module_doc, "Windows::Media::ClosedCaptioning");


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

} // py::cpp::Windows::Media::ClosedCaptioning

PyMODINIT_FUNC PyInit__winrt_windows_media_closedcaptioning(void) noexcept
{
    using namespace py::cpp::Windows::Media::ClosedCaptioning;

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

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

    if (!module)
    {
        return nullptr;
    }

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

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

    if (!object_bases)
    {
        return nullptr;
    }

    py::pyobj_handle type_ClosedCaptionProperties_Static{PyType_FromSpec(&type_spec_ClosedCaptionProperties_Static)};
    if (!type_ClosedCaptionProperties_Static)
    {
        return nullptr;
    }

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


    return module.detach();
}
