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

#include "pybase.h"
#include "py.Windows.Media.Protection.h"

PyTypeObject* py::winrt_type<winrt::Windows::Media::Protection::ComponentLoadFailedEventArgs>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Media::Protection::HdcpSession>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Media::Protection::MediaProtectionManager>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Media::Protection::MediaProtectionPMPServer>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Media::Protection::MediaProtectionServiceCompletion>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Media::Protection::ProtectionCapabilities>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Media::Protection::RevocationAndRenewalInformation>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Media::Protection::RevocationAndRenewalItem>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Media::Protection::ServiceRequestedEventArgs>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Media::Protection::IMediaProtectionServiceRequest>::python_type;

namespace py::cpp::Windows::Media::Protection
{
    // ----- ComponentLoadFailedEventArgs class --------------------
    constexpr const char* const _type_name_ComponentLoadFailedEventArgs = "ComponentLoadFailedEventArgs";

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

    static void _dealloc_ComponentLoadFailedEventArgs(py::wrapper::Windows::Media::Protection::ComponentLoadFailedEventArgs* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* ComponentLoadFailedEventArgs_get_Completion(py::wrapper::Windows::Media::Protection::ComponentLoadFailedEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Completion());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* ComponentLoadFailedEventArgs_get_Information(py::wrapper::Windows::Media::Protection::ComponentLoadFailedEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Information());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_ComponentLoadFailedEventArgs(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::Media::Protection::ComponentLoadFailedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_ComponentLoadFailedEventArgs[] = {
        { "_from", reinterpret_cast<PyCFunction>(_from_ComponentLoadFailedEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_ComponentLoadFailedEventArgs[] = {
        { "completion", reinterpret_cast<getter>(ComponentLoadFailedEventArgs_get_Completion), nullptr, nullptr, nullptr },
        { "information", reinterpret_cast<getter>(ComponentLoadFailedEventArgs_get_Information), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_ComponentLoadFailedEventArgs[] = 
    {
        { Py_tp_new, _new_ComponentLoadFailedEventArgs },
        { Py_tp_dealloc, _dealloc_ComponentLoadFailedEventArgs },
        { Py_tp_methods, _methods_ComponentLoadFailedEventArgs },
        { Py_tp_getset, _getset_ComponentLoadFailedEventArgs },
        { },
    };

    static PyType_Spec _type_spec_ComponentLoadFailedEventArgs =
    {
        "_winsdk_Windows_Media_Protection.ComponentLoadFailedEventArgs",
        sizeof(py::wrapper::Windows::Media::Protection::ComponentLoadFailedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_ComponentLoadFailedEventArgs
    };

    // ----- HdcpSession class --------------------
    constexpr const char* const _type_name_HdcpSession = "HdcpSession";

    static PyObject* _new_HdcpSession(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        if (kwds != nullptr)
        {
            py::set_invalid_kwd_args_error();
            return nullptr;
        }

        Py_ssize_t arg_count = PyTuple_Size(args);
        if (arg_count == 0)
        {
            try
            {
                winrt::Windows::Media::Protection::HdcpSession instance{  };
                return py::wrap(instance, type);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static void _dealloc_HdcpSession(py::wrapper::Windows::Media::Protection::HdcpSession* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* HdcpSession_Close(py::wrapper::Windows::Media::Protection::HdcpSession* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

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

    static PyObject* HdcpSession_GetEffectiveProtection(py::wrapper::Windows::Media::Protection::HdcpSession* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

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

    static PyObject* HdcpSession_IsEffectiveProtectionAtLeast(py::wrapper::Windows::Media::Protection::HdcpSession* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Media::Protection::HdcpProtection>(args, 0);

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

    static PyObject* HdcpSession_SetDesiredMinProtectionAsync(py::wrapper::Windows::Media::Protection::HdcpSession* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Media::Protection::HdcpProtection>(args, 0);

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

    static PyObject* HdcpSession_add_ProtectionChanged(py::wrapper::Windows::Media::Protection::HdcpSession* self, PyObject* arg) noexcept
    {
        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Protection::HdcpSession, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* HdcpSession_remove_ProtectionChanged(py::wrapper::Windows::Media::Protection::HdcpSession* self, PyObject* arg) noexcept
    {
        try
        {
            auto param0 = py::convert_to<winrt::event_token>(arg);

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

    static PyObject* _from_HdcpSession(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::Media::Protection::HdcpSession>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _enter_HdcpSession(py::wrapper::Windows::Media::Protection::HdcpSession* self) noexcept
    {
        Py_INCREF(self);
        return reinterpret_cast<PyObject*>(self);
    }

    static PyObject* _exit_HdcpSession(py::wrapper::Windows::Media::Protection::HdcpSession* self) noexcept
    {
        try
        {
            self->obj.Close();
            Py_RETURN_FALSE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_HdcpSession[] = {
        { "close", reinterpret_cast<PyCFunction>(HdcpSession_Close), METH_VARARGS, nullptr },
        { "get_effective_protection", reinterpret_cast<PyCFunction>(HdcpSession_GetEffectiveProtection), METH_VARARGS, nullptr },
        { "is_effective_protection_at_least", reinterpret_cast<PyCFunction>(HdcpSession_IsEffectiveProtectionAtLeast), METH_VARARGS, nullptr },
        { "set_desired_min_protection_async", reinterpret_cast<PyCFunction>(HdcpSession_SetDesiredMinProtectionAsync), METH_VARARGS, nullptr },
        { "add_protection_changed", reinterpret_cast<PyCFunction>(HdcpSession_add_ProtectionChanged), METH_O, nullptr },
        { "remove_protection_changed", reinterpret_cast<PyCFunction>(HdcpSession_remove_ProtectionChanged), METH_O, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_HdcpSession), METH_O | METH_STATIC, nullptr },
        { "__enter__", reinterpret_cast<PyCFunction>(_enter_HdcpSession), METH_NOARGS, nullptr },
        { "__exit__",  reinterpret_cast<PyCFunction>(_exit_HdcpSession), METH_VARARGS, nullptr },
        { }
    };

    static PyGetSetDef _getset_HdcpSession[] = {
        { }
    };

    static PyType_Slot _type_slots_HdcpSession[] = 
    {
        { Py_tp_new, _new_HdcpSession },
        { Py_tp_dealloc, _dealloc_HdcpSession },
        { Py_tp_methods, _methods_HdcpSession },
        { Py_tp_getset, _getset_HdcpSession },
        { },
    };

    static PyType_Spec _type_spec_HdcpSession =
    {
        "_winsdk_Windows_Media_Protection.HdcpSession",
        sizeof(py::wrapper::Windows::Media::Protection::HdcpSession),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_HdcpSession
    };

    // ----- MediaProtectionManager class --------------------
    constexpr const char* const _type_name_MediaProtectionManager = "MediaProtectionManager";

    static PyObject* _new_MediaProtectionManager(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        if (kwds != nullptr)
        {
            py::set_invalid_kwd_args_error();
            return nullptr;
        }

        Py_ssize_t arg_count = PyTuple_Size(args);
        if (arg_count == 0)
        {
            try
            {
                winrt::Windows::Media::Protection::MediaProtectionManager instance{  };
                return py::wrap(instance, type);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static void _dealloc_MediaProtectionManager(py::wrapper::Windows::Media::Protection::MediaProtectionManager* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* MediaProtectionManager_get_Properties(py::wrapper::Windows::Media::Protection::MediaProtectionManager* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Properties());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* MediaProtectionManager_add_ComponentLoadFailed(py::wrapper::Windows::Media::Protection::MediaProtectionManager* self, PyObject* arg) noexcept
    {
        try
        {
            auto param0 = py::convert_to<winrt::Windows::Media::Protection::ComponentLoadFailedEventHandler>(arg);

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

    static PyObject* MediaProtectionManager_remove_ComponentLoadFailed(py::wrapper::Windows::Media::Protection::MediaProtectionManager* self, PyObject* arg) noexcept
    {
        try
        {
            auto param0 = py::convert_to<winrt::event_token>(arg);

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

    static PyObject* MediaProtectionManager_add_RebootNeeded(py::wrapper::Windows::Media::Protection::MediaProtectionManager* self, PyObject* arg) noexcept
    {
        try
        {
            auto param0 = py::convert_to<winrt::Windows::Media::Protection::RebootNeededEventHandler>(arg);

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

    static PyObject* MediaProtectionManager_remove_RebootNeeded(py::wrapper::Windows::Media::Protection::MediaProtectionManager* self, PyObject* arg) noexcept
    {
        try
        {
            auto param0 = py::convert_to<winrt::event_token>(arg);

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

    static PyObject* MediaProtectionManager_add_ServiceRequested(py::wrapper::Windows::Media::Protection::MediaProtectionManager* self, PyObject* arg) noexcept
    {
        try
        {
            auto param0 = py::convert_to<winrt::Windows::Media::Protection::ServiceRequestedEventHandler>(arg);

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

    static PyObject* MediaProtectionManager_remove_ServiceRequested(py::wrapper::Windows::Media::Protection::MediaProtectionManager* self, PyObject* arg) noexcept
    {
        try
        {
            auto param0 = py::convert_to<winrt::event_token>(arg);

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

    static PyObject* _from_MediaProtectionManager(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::Media::Protection::MediaProtectionManager>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_MediaProtectionManager[] = {
        { "add_component_load_failed", reinterpret_cast<PyCFunction>(MediaProtectionManager_add_ComponentLoadFailed), METH_O, nullptr },
        { "remove_component_load_failed", reinterpret_cast<PyCFunction>(MediaProtectionManager_remove_ComponentLoadFailed), METH_O, nullptr },
        { "add_reboot_needed", reinterpret_cast<PyCFunction>(MediaProtectionManager_add_RebootNeeded), METH_O, nullptr },
        { "remove_reboot_needed", reinterpret_cast<PyCFunction>(MediaProtectionManager_remove_RebootNeeded), METH_O, nullptr },
        { "add_service_requested", reinterpret_cast<PyCFunction>(MediaProtectionManager_add_ServiceRequested), METH_O, nullptr },
        { "remove_service_requested", reinterpret_cast<PyCFunction>(MediaProtectionManager_remove_ServiceRequested), METH_O, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_MediaProtectionManager), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_MediaProtectionManager[] = {
        { "properties", reinterpret_cast<getter>(MediaProtectionManager_get_Properties), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_MediaProtectionManager[] = 
    {
        { Py_tp_new, _new_MediaProtectionManager },
        { Py_tp_dealloc, _dealloc_MediaProtectionManager },
        { Py_tp_methods, _methods_MediaProtectionManager },
        { Py_tp_getset, _getset_MediaProtectionManager },
        { },
    };

    static PyType_Spec _type_spec_MediaProtectionManager =
    {
        "_winsdk_Windows_Media_Protection.MediaProtectionManager",
        sizeof(py::wrapper::Windows::Media::Protection::MediaProtectionManager),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_MediaProtectionManager
    };

    // ----- MediaProtectionPMPServer class --------------------
    constexpr const char* const _type_name_MediaProtectionPMPServer = "MediaProtectionPMPServer";

    static PyObject* _new_MediaProtectionPMPServer(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        if (kwds != nullptr)
        {
            py::set_invalid_kwd_args_error();
            return nullptr;
        }

        Py_ssize_t arg_count = PyTuple_Size(args);
        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Foundation::Collections::IPropertySet>(args, 0);

                winrt::Windows::Media::Protection::MediaProtectionPMPServer instance{ param0 };
                return py::wrap(instance, type);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static void _dealloc_MediaProtectionPMPServer(py::wrapper::Windows::Media::Protection::MediaProtectionPMPServer* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* MediaProtectionPMPServer_get_Properties(py::wrapper::Windows::Media::Protection::MediaProtectionPMPServer* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Properties());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_MediaProtectionPMPServer(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::Media::Protection::MediaProtectionPMPServer>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_MediaProtectionPMPServer[] = {
        { "_from", reinterpret_cast<PyCFunction>(_from_MediaProtectionPMPServer), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_MediaProtectionPMPServer[] = {
        { "properties", reinterpret_cast<getter>(MediaProtectionPMPServer_get_Properties), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_MediaProtectionPMPServer[] = 
    {
        { Py_tp_new, _new_MediaProtectionPMPServer },
        { Py_tp_dealloc, _dealloc_MediaProtectionPMPServer },
        { Py_tp_methods, _methods_MediaProtectionPMPServer },
        { Py_tp_getset, _getset_MediaProtectionPMPServer },
        { },
    };

    static PyType_Spec _type_spec_MediaProtectionPMPServer =
    {
        "_winsdk_Windows_Media_Protection.MediaProtectionPMPServer",
        sizeof(py::wrapper::Windows::Media::Protection::MediaProtectionPMPServer),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_MediaProtectionPMPServer
    };

    // ----- MediaProtectionServiceCompletion class --------------------
    constexpr const char* const _type_name_MediaProtectionServiceCompletion = "MediaProtectionServiceCompletion";

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

    static void _dealloc_MediaProtectionServiceCompletion(py::wrapper::Windows::Media::Protection::MediaProtectionServiceCompletion* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* MediaProtectionServiceCompletion_Complete(py::wrapper::Windows::Media::Protection::MediaProtectionServiceCompletion* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<bool>(args, 0);

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

    static PyObject* _from_MediaProtectionServiceCompletion(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::Media::Protection::MediaProtectionServiceCompletion>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_MediaProtectionServiceCompletion[] = {
        { "complete", reinterpret_cast<PyCFunction>(MediaProtectionServiceCompletion_Complete), METH_VARARGS, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_MediaProtectionServiceCompletion), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_MediaProtectionServiceCompletion[] = {
        { }
    };

    static PyType_Slot _type_slots_MediaProtectionServiceCompletion[] = 
    {
        { Py_tp_new, _new_MediaProtectionServiceCompletion },
        { Py_tp_dealloc, _dealloc_MediaProtectionServiceCompletion },
        { Py_tp_methods, _methods_MediaProtectionServiceCompletion },
        { Py_tp_getset, _getset_MediaProtectionServiceCompletion },
        { },
    };

    static PyType_Spec _type_spec_MediaProtectionServiceCompletion =
    {
        "_winsdk_Windows_Media_Protection.MediaProtectionServiceCompletion",
        sizeof(py::wrapper::Windows::Media::Protection::MediaProtectionServiceCompletion),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_MediaProtectionServiceCompletion
    };

    // ----- ProtectionCapabilities class --------------------
    constexpr const char* const _type_name_ProtectionCapabilities = "ProtectionCapabilities";

    static PyObject* _new_ProtectionCapabilities(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        if (kwds != nullptr)
        {
            py::set_invalid_kwd_args_error();
            return nullptr;
        }

        Py_ssize_t arg_count = PyTuple_Size(args);
        if (arg_count == 0)
        {
            try
            {
                winrt::Windows::Media::Protection::ProtectionCapabilities instance{  };
                return py::wrap(instance, type);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static void _dealloc_ProtectionCapabilities(py::wrapper::Windows::Media::Protection::ProtectionCapabilities* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* ProtectionCapabilities_IsTypeSupported(py::wrapper::Windows::Media::Protection::ProtectionCapabilities* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            try
            {
                auto param0 = py::convert_to<winrt::hstring>(args, 0);
                auto param1 = py::convert_to<winrt::hstring>(args, 1);

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

    static PyObject* _from_ProtectionCapabilities(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::Media::Protection::ProtectionCapabilities>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_ProtectionCapabilities[] = {
        { "is_type_supported", reinterpret_cast<PyCFunction>(ProtectionCapabilities_IsTypeSupported), METH_VARARGS, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_ProtectionCapabilities), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_ProtectionCapabilities[] = {
        { }
    };

    static PyType_Slot _type_slots_ProtectionCapabilities[] = 
    {
        { Py_tp_new, _new_ProtectionCapabilities },
        { Py_tp_dealloc, _dealloc_ProtectionCapabilities },
        { Py_tp_methods, _methods_ProtectionCapabilities },
        { Py_tp_getset, _getset_ProtectionCapabilities },
        { },
    };

    static PyType_Spec _type_spec_ProtectionCapabilities =
    {
        "_winsdk_Windows_Media_Protection.ProtectionCapabilities",
        sizeof(py::wrapper::Windows::Media::Protection::ProtectionCapabilities),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_ProtectionCapabilities
    };

    // ----- RevocationAndRenewalInformation class --------------------
    constexpr const char* const _type_name_RevocationAndRenewalInformation = "RevocationAndRenewalInformation";

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

    static void _dealloc_RevocationAndRenewalInformation(py::wrapper::Windows::Media::Protection::RevocationAndRenewalInformation* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* RevocationAndRenewalInformation_get_Items(py::wrapper::Windows::Media::Protection::RevocationAndRenewalInformation* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Items());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_RevocationAndRenewalInformation(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::Media::Protection::RevocationAndRenewalInformation>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_RevocationAndRenewalInformation[] = {
        { "_from", reinterpret_cast<PyCFunction>(_from_RevocationAndRenewalInformation), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_RevocationAndRenewalInformation[] = {
        { "items", reinterpret_cast<getter>(RevocationAndRenewalInformation_get_Items), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_RevocationAndRenewalInformation[] = 
    {
        { Py_tp_new, _new_RevocationAndRenewalInformation },
        { Py_tp_dealloc, _dealloc_RevocationAndRenewalInformation },
        { Py_tp_methods, _methods_RevocationAndRenewalInformation },
        { Py_tp_getset, _getset_RevocationAndRenewalInformation },
        { },
    };

    static PyType_Spec _type_spec_RevocationAndRenewalInformation =
    {
        "_winsdk_Windows_Media_Protection.RevocationAndRenewalInformation",
        sizeof(py::wrapper::Windows::Media::Protection::RevocationAndRenewalInformation),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_RevocationAndRenewalInformation
    };

    // ----- RevocationAndRenewalItem class --------------------
    constexpr const char* const _type_name_RevocationAndRenewalItem = "RevocationAndRenewalItem";

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

    static void _dealloc_RevocationAndRenewalItem(py::wrapper::Windows::Media::Protection::RevocationAndRenewalItem* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* RevocationAndRenewalItem_get_HeaderHash(py::wrapper::Windows::Media::Protection::RevocationAndRenewalItem* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.HeaderHash());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* RevocationAndRenewalItem_get_Name(py::wrapper::Windows::Media::Protection::RevocationAndRenewalItem* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Name());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* RevocationAndRenewalItem_get_PublicKeyHash(py::wrapper::Windows::Media::Protection::RevocationAndRenewalItem* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.PublicKeyHash());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* RevocationAndRenewalItem_get_Reasons(py::wrapper::Windows::Media::Protection::RevocationAndRenewalItem* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Reasons());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* RevocationAndRenewalItem_get_RenewalId(py::wrapper::Windows::Media::Protection::RevocationAndRenewalItem* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.RenewalId());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_RevocationAndRenewalItem(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::Media::Protection::RevocationAndRenewalItem>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_RevocationAndRenewalItem[] = {
        { "_from", reinterpret_cast<PyCFunction>(_from_RevocationAndRenewalItem), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_RevocationAndRenewalItem[] = {
        { "header_hash", reinterpret_cast<getter>(RevocationAndRenewalItem_get_HeaderHash), nullptr, nullptr, nullptr },
        { "name", reinterpret_cast<getter>(RevocationAndRenewalItem_get_Name), nullptr, nullptr, nullptr },
        { "public_key_hash", reinterpret_cast<getter>(RevocationAndRenewalItem_get_PublicKeyHash), nullptr, nullptr, nullptr },
        { "reasons", reinterpret_cast<getter>(RevocationAndRenewalItem_get_Reasons), nullptr, nullptr, nullptr },
        { "renewal_id", reinterpret_cast<getter>(RevocationAndRenewalItem_get_RenewalId), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_RevocationAndRenewalItem[] = 
    {
        { Py_tp_new, _new_RevocationAndRenewalItem },
        { Py_tp_dealloc, _dealloc_RevocationAndRenewalItem },
        { Py_tp_methods, _methods_RevocationAndRenewalItem },
        { Py_tp_getset, _getset_RevocationAndRenewalItem },
        { },
    };

    static PyType_Spec _type_spec_RevocationAndRenewalItem =
    {
        "_winsdk_Windows_Media_Protection.RevocationAndRenewalItem",
        sizeof(py::wrapper::Windows::Media::Protection::RevocationAndRenewalItem),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_RevocationAndRenewalItem
    };

    // ----- ServiceRequestedEventArgs class --------------------
    constexpr const char* const _type_name_ServiceRequestedEventArgs = "ServiceRequestedEventArgs";

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

    static void _dealloc_ServiceRequestedEventArgs(py::wrapper::Windows::Media::Protection::ServiceRequestedEventArgs* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* ServiceRequestedEventArgs_get_Completion(py::wrapper::Windows::Media::Protection::ServiceRequestedEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Completion());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* ServiceRequestedEventArgs_get_Request(py::wrapper::Windows::Media::Protection::ServiceRequestedEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Request());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* ServiceRequestedEventArgs_get_MediaPlaybackItem(py::wrapper::Windows::Media::Protection::ServiceRequestedEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.MediaPlaybackItem());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_ServiceRequestedEventArgs(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::Media::Protection::ServiceRequestedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_ServiceRequestedEventArgs[] = {
        { "_from", reinterpret_cast<PyCFunction>(_from_ServiceRequestedEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_ServiceRequestedEventArgs[] = {
        { "completion", reinterpret_cast<getter>(ServiceRequestedEventArgs_get_Completion), nullptr, nullptr, nullptr },
        { "request", reinterpret_cast<getter>(ServiceRequestedEventArgs_get_Request), nullptr, nullptr, nullptr },
        { "media_playback_item", reinterpret_cast<getter>(ServiceRequestedEventArgs_get_MediaPlaybackItem), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_ServiceRequestedEventArgs[] = 
    {
        { Py_tp_new, _new_ServiceRequestedEventArgs },
        { Py_tp_dealloc, _dealloc_ServiceRequestedEventArgs },
        { Py_tp_methods, _methods_ServiceRequestedEventArgs },
        { Py_tp_getset, _getset_ServiceRequestedEventArgs },
        { },
    };

    static PyType_Spec _type_spec_ServiceRequestedEventArgs =
    {
        "_winsdk_Windows_Media_Protection.ServiceRequestedEventArgs",
        sizeof(py::wrapper::Windows::Media::Protection::ServiceRequestedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_ServiceRequestedEventArgs
    };

    // ----- IMediaProtectionServiceRequest interface --------------------
    constexpr const char* const _type_name_IMediaProtectionServiceRequest = "IMediaProtectionServiceRequest";

    static PyObject* _new_IMediaProtectionServiceRequest(PyTypeObject* /* unused */, PyObject* /* unused */, PyObject* /* unused */)
    {
        py::set_invalid_activation_error(_type_name_IMediaProtectionServiceRequest);
        return nullptr;
    }

    static void _dealloc_IMediaProtectionServiceRequest(py::wrapper::Windows::Media::Protection::IMediaProtectionServiceRequest* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* IMediaProtectionServiceRequest_get_ProtectionSystem(py::wrapper::Windows::Media::Protection::IMediaProtectionServiceRequest* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.ProtectionSystem());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* IMediaProtectionServiceRequest_get_Type(py::wrapper::Windows::Media::Protection::IMediaProtectionServiceRequest* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Type());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_IMediaProtectionServiceRequest(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::Media::Protection::IMediaProtectionServiceRequest>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_IMediaProtectionServiceRequest[] = {
        { "_from", reinterpret_cast<PyCFunction>(_from_IMediaProtectionServiceRequest), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_IMediaProtectionServiceRequest[] = {
        { "protection_system", reinterpret_cast<getter>(IMediaProtectionServiceRequest_get_ProtectionSystem), nullptr, nullptr, nullptr },
        { "type", reinterpret_cast<getter>(IMediaProtectionServiceRequest_get_Type), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_IMediaProtectionServiceRequest[] = 
    {
        { Py_tp_new, _new_IMediaProtectionServiceRequest },
        { Py_tp_dealloc, _dealloc_IMediaProtectionServiceRequest },
        { Py_tp_methods, _methods_IMediaProtectionServiceRequest },
        { Py_tp_getset, _getset_IMediaProtectionServiceRequest },
        { },
    };

    static PyType_Spec _type_spec_IMediaProtectionServiceRequest =
    {
        "_winsdk_Windows_Media_Protection.IMediaProtectionServiceRequest",
        sizeof(py::wrapper::Windows::Media::Protection::IMediaProtectionServiceRequest),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_IMediaProtectionServiceRequest
    };

    // ----- Windows.Media.Protection 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::Media::Protection::ComponentLoadFailedEventArgs>::python_type = py::register_python_type(module, _type_name_ComponentLoadFailedEventArgs, &_type_spec_ComponentLoadFailedEventArgs, bases.get());
            py::winrt_type<winrt::Windows::Media::Protection::HdcpSession>::python_type = py::register_python_type(module, _type_name_HdcpSession, &_type_spec_HdcpSession, bases.get());
            py::winrt_type<winrt::Windows::Media::Protection::MediaProtectionManager>::python_type = py::register_python_type(module, _type_name_MediaProtectionManager, &_type_spec_MediaProtectionManager, bases.get());
            py::winrt_type<winrt::Windows::Media::Protection::MediaProtectionPMPServer>::python_type = py::register_python_type(module, _type_name_MediaProtectionPMPServer, &_type_spec_MediaProtectionPMPServer, bases.get());
            py::winrt_type<winrt::Windows::Media::Protection::MediaProtectionServiceCompletion>::python_type = py::register_python_type(module, _type_name_MediaProtectionServiceCompletion, &_type_spec_MediaProtectionServiceCompletion, bases.get());
            py::winrt_type<winrt::Windows::Media::Protection::ProtectionCapabilities>::python_type = py::register_python_type(module, _type_name_ProtectionCapabilities, &_type_spec_ProtectionCapabilities, bases.get());
            py::winrt_type<winrt::Windows::Media::Protection::RevocationAndRenewalInformation>::python_type = py::register_python_type(module, _type_name_RevocationAndRenewalInformation, &_type_spec_RevocationAndRenewalInformation, bases.get());
            py::winrt_type<winrt::Windows::Media::Protection::RevocationAndRenewalItem>::python_type = py::register_python_type(module, _type_name_RevocationAndRenewalItem, &_type_spec_RevocationAndRenewalItem, bases.get());
            py::winrt_type<winrt::Windows::Media::Protection::ServiceRequestedEventArgs>::python_type = py::register_python_type(module, _type_name_ServiceRequestedEventArgs, &_type_spec_ServiceRequestedEventArgs, bases.get());
            py::winrt_type<winrt::Windows::Media::Protection::IMediaProtectionServiceRequest>::python_type = py::register_python_type(module, _type_name_IMediaProtectionServiceRequest, &_type_spec_IMediaProtectionServiceRequest, 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.Media.Protection");

    static PyModuleDef module_def
        = {PyModuleDef_HEAD_INIT,
           "_winsdk_Windows_Media_Protection",
           module_doc,
           0,
           nullptr,
           module_slots,
           nullptr,
           nullptr,
           nullptr};
} // py::cpp::Windows::Media::Protection

PyMODINIT_FUNC
PyInit__winsdk_Windows_Media_Protection (void) noexcept
{
    return PyModuleDef_Init(&py::cpp::Windows::Media::Protection::module_def);
}
