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

#pragma once

#include "pybase.h"
static_assert(winrt::check_version(PYWINRT_VERSION, "3.2.1"), "Mismatched Py/WinRT headers.");
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Media.Playback.h>

#include <winrt/Windows.Media.Protection.h>

namespace py::proj::Windows::Media::Protection
{
}

namespace py
{
    template<>
    inline constexpr const char* buffer_format<winrt::Windows::Media::Protection::GraphicsTrustStatus> = "i";

    template<>
    inline constexpr const char* buffer_format<winrt::Windows::Media::Protection::HdcpProtection> = "i";

    template<>
    inline constexpr const char* buffer_format<winrt::Windows::Media::Protection::HdcpSetProtectionResult> = "i";

    template<>
    inline constexpr const char* buffer_format<winrt::Windows::Media::Protection::ProtectionCapabilityResult> = "i";

    template<>
    inline constexpr const char* buffer_format<winrt::Windows::Media::Protection::RenewalStatus> = "i";

    template<>
    inline constexpr const char* buffer_format<winrt::Windows::Media::Protection::RevocationAndRenewalReasons> = "I";


    template<>
    struct py_type<winrt::Windows::Media::Protection::GraphicsTrustStatus>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.media.protection.GraphicsTrustStatus";
        static constexpr const char* module_name = "winrt.windows.media.protection";
        static constexpr const char* type_name = "GraphicsTrustStatus";
    };

    template<>
    struct py_type<winrt::Windows::Media::Protection::HdcpProtection>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.media.protection.HdcpProtection";
        static constexpr const char* module_name = "winrt.windows.media.protection";
        static constexpr const char* type_name = "HdcpProtection";
    };

    template<>
    struct py_type<winrt::Windows::Media::Protection::HdcpSetProtectionResult>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.media.protection.HdcpSetProtectionResult";
        static constexpr const char* module_name = "winrt.windows.media.protection";
        static constexpr const char* type_name = "HdcpSetProtectionResult";
    };

    template<>
    struct py_type<winrt::Windows::Media::Protection::ProtectionCapabilityResult>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.media.protection.ProtectionCapabilityResult";
        static constexpr const char* module_name = "winrt.windows.media.protection";
        static constexpr const char* type_name = "ProtectionCapabilityResult";
    };

    template<>
    struct py_type<winrt::Windows::Media::Protection::RenewalStatus>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.media.protection.RenewalStatus";
        static constexpr const char* module_name = "winrt.windows.media.protection";
        static constexpr const char* type_name = "RenewalStatus";
    };

    template<>
    struct py_type<winrt::Windows::Media::Protection::RevocationAndRenewalReasons>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.media.protection.RevocationAndRenewalReasons";
        static constexpr const char* module_name = "winrt.windows.media.protection";
        static constexpr const char* type_name = "RevocationAndRenewalReasons";
    };

    template<>
    struct py_type<winrt::Windows::Media::Protection::ComponentLoadFailedEventArgs>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.media.protection.ComponentLoadFailedEventArgs";
        static constexpr const char* module_name = "winrt.windows.media.protection";
        static constexpr const char* type_name = "ComponentLoadFailedEventArgs";
    };

    template<>
    struct py_type<winrt::Windows::Media::Protection::ComponentRenewal>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.media.protection.ComponentRenewal";
        static constexpr const char* module_name = "winrt.windows.media.protection";
        static constexpr const char* type_name = "ComponentRenewal";
    };

    template<>
    struct py_type<winrt::Windows::Media::Protection::HdcpSession>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.media.protection.HdcpSession";
        static constexpr const char* module_name = "winrt.windows.media.protection";
        static constexpr const char* type_name = "HdcpSession";
    };

    template<>
    struct py_type<winrt::Windows::Media::Protection::MediaProtectionManager>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.media.protection.MediaProtectionManager";
        static constexpr const char* module_name = "winrt.windows.media.protection";
        static constexpr const char* type_name = "MediaProtectionManager";
    };

    template<>
    struct py_type<winrt::Windows::Media::Protection::MediaProtectionPMPServer>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.media.protection.MediaProtectionPMPServer";
        static constexpr const char* module_name = "winrt.windows.media.protection";
        static constexpr const char* type_name = "MediaProtectionPMPServer";
    };

    template<>
    struct py_type<winrt::Windows::Media::Protection::MediaProtectionServiceCompletion>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.media.protection.MediaProtectionServiceCompletion";
        static constexpr const char* module_name = "winrt.windows.media.protection";
        static constexpr const char* type_name = "MediaProtectionServiceCompletion";
    };

    template<>
    struct py_type<winrt::Windows::Media::Protection::ProtectionCapabilities>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.media.protection.ProtectionCapabilities";
        static constexpr const char* module_name = "winrt.windows.media.protection";
        static constexpr const char* type_name = "ProtectionCapabilities";
    };

    template<>
    struct py_type<winrt::Windows::Media::Protection::RevocationAndRenewalInformation>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.media.protection.RevocationAndRenewalInformation";
        static constexpr const char* module_name = "winrt.windows.media.protection";
        static constexpr const char* type_name = "RevocationAndRenewalInformation";
    };

    template<>
    struct py_type<winrt::Windows::Media::Protection::RevocationAndRenewalItem>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.media.protection.RevocationAndRenewalItem";
        static constexpr const char* module_name = "winrt.windows.media.protection";
        static constexpr const char* type_name = "RevocationAndRenewalItem";
    };

    template<>
    struct py_type<winrt::Windows::Media::Protection::ServiceRequestedEventArgs>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.media.protection.ServiceRequestedEventArgs";
        static constexpr const char* module_name = "winrt.windows.media.protection";
        static constexpr const char* type_name = "ServiceRequestedEventArgs";
    };

    template<>
    struct py_type<winrt::Windows::Media::Protection::IMediaProtectionServiceRequest>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.media.protection._IMediaProtectionServiceRequest";
        static constexpr const char* module_name = "winrt.windows.media.protection";
        static constexpr const char* type_name = "_IMediaProtectionServiceRequest";
    };
}

#if __has_include("py.Windows.Foundation.h")
#include "py.Windows.Foundation.h"
#endif

#if __has_include("py.Windows.Foundation.Collections.h")
#include "py.Windows.Foundation.Collections.h"
#endif

#if __has_include("py.Windows.Media.Playback.h")
#include "py.Windows.Media.Playback.h"
#endif

namespace py::impl::Windows::Media::Protection
{
    struct ComponentLoadFailedEventHandler
    {
        static winrt::Windows::Media::Protection::ComponentLoadFailedEventHandler get(PyObject* callable)
        {
            py::delegate_callable _delegate{ callable };

            return [delegate = std::move(_delegate)](winrt::Windows::Media::Protection::MediaProtectionManager const& param0, winrt::Windows::Media::Protection::ComponentLoadFailedEventArgs const& param1)
            {
                auto gil = py::ensure_gil();

                try
                {
                    py::pyobj_handle py_param0{py::convert(param0)};
                    if (!py_param0)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle py_param1{py::convert(param1)};
                    if (!py_param1)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle args{PyTuple_Pack(2, py_param0.get(), py_param1.get())};
                    if (!args)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle return_value{PyObject_CallObject(delegate.callable(), args.get())};
                    if (!return_value)
                    {
                        throw python_exception();
                    }
                }
                catch (python_exception)
                {
                    py::write_unraisable_and_throw();
                }
            };
        };
    };

    struct RebootNeededEventHandler
    {
        static winrt::Windows::Media::Protection::RebootNeededEventHandler get(PyObject* callable)
        {
            py::delegate_callable _delegate{ callable };

            return [delegate = std::move(_delegate)](winrt::Windows::Media::Protection::MediaProtectionManager const& param0)
            {
                auto gil = py::ensure_gil();

                try
                {
                    py::pyobj_handle py_param0{py::convert(param0)};
                    if (!py_param0)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle return_value{PyObject_CallOneArg(delegate.callable(), py_param0.get())};
                    if (!return_value)
                    {
                        throw python_exception();
                    }
                }
                catch (python_exception)
                {
                    py::write_unraisable_and_throw();
                }
            };
        };
    };

    struct ServiceRequestedEventHandler
    {
        static winrt::Windows::Media::Protection::ServiceRequestedEventHandler get(PyObject* callable)
        {
            py::delegate_callable _delegate{ callable };

            return [delegate = std::move(_delegate)](winrt::Windows::Media::Protection::MediaProtectionManager const& param0, winrt::Windows::Media::Protection::ServiceRequestedEventArgs const& param1)
            {
                auto gil = py::ensure_gil();

                try
                {
                    py::pyobj_handle py_param0{py::convert(param0)};
                    if (!py_param0)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle py_param1{py::convert(param1)};
                    if (!py_param1)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle args{PyTuple_Pack(2, py_param0.get(), py_param1.get())};
                    if (!args)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle return_value{PyObject_CallObject(delegate.callable(), args.get())};
                    if (!return_value)
                    {
                        throw python_exception();
                    }
                }
                catch (python_exception)
                {
                    py::write_unraisable_and_throw();
                }
            };
        };
    };
}

namespace py::wrapper::Windows::Media::Protection
{
    using ComponentLoadFailedEventArgs = py::winrt_wrapper<winrt::Windows::Media::Protection::ComponentLoadFailedEventArgs>;
    using ComponentRenewal = py::winrt_wrapper<winrt::Windows::Media::Protection::ComponentRenewal>;
    using HdcpSession = py::winrt_wrapper<winrt::Windows::Media::Protection::HdcpSession>;
    using MediaProtectionManager = py::winrt_wrapper<winrt::Windows::Media::Protection::MediaProtectionManager>;
    using MediaProtectionPMPServer = py::winrt_wrapper<winrt::Windows::Media::Protection::MediaProtectionPMPServer>;
    using MediaProtectionServiceCompletion = py::winrt_wrapper<winrt::Windows::Media::Protection::MediaProtectionServiceCompletion>;
    using ProtectionCapabilities = py::winrt_wrapper<winrt::Windows::Media::Protection::ProtectionCapabilities>;
    using RevocationAndRenewalInformation = py::winrt_wrapper<winrt::Windows::Media::Protection::RevocationAndRenewalInformation>;
    using RevocationAndRenewalItem = py::winrt_wrapper<winrt::Windows::Media::Protection::RevocationAndRenewalItem>;
    using ServiceRequestedEventArgs = py::winrt_wrapper<winrt::Windows::Media::Protection::ServiceRequestedEventArgs>;
    using IMediaProtectionServiceRequest = py::winrt_wrapper<winrt::Windows::Media::Protection::IMediaProtectionServiceRequest>;
}

namespace py
{
    template <>
    struct delegate_python_type<winrt::Windows::Media::Protection::ComponentLoadFailedEventHandler>
    {
        using type = py::impl::Windows::Media::Protection::ComponentLoadFailedEventHandler;
    };

    template <>
    struct delegate_python_type<winrt::Windows::Media::Protection::RebootNeededEventHandler>
    {
        using type = py::impl::Windows::Media::Protection::RebootNeededEventHandler;
    };

    template <>
    struct delegate_python_type<winrt::Windows::Media::Protection::ServiceRequestedEventHandler>
    {
        using type = py::impl::Windows::Media::Protection::ServiceRequestedEventHandler;
    };

}
