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

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


namespace py::cpp::Windows::Media::AppRecording
{
    // ----- AppRecordingManager class --------------------

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

    static void _dealloc_AppRecordingManager(py::wrapper::Windows::Media::AppRecording::AppRecordingManager* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* AppRecordingManager_GetDefault(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.AppRecording.AppRecordingManager", L"GetDefault", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Media::AppRecording::AppRecordingManager::GetDefault());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* AppRecordingManager_GetStatus(py::wrapper::Windows::Media::AppRecording::AppRecordingManager* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.AppRecording.AppRecordingManager", L"GetStatus", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* AppRecordingManager_RecordTimeSpanToFileAsync(py::wrapper::Windows::Media::AppRecording::AppRecordingManager* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 3)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.AppRecording.AppRecordingManager", L"RecordTimeSpanToFileAsync", 3))
            {
                py::set_arg_count_version_error(3);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Foundation::DateTime>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::TimeSpan>(args, 1);
                auto param2 = py::convert_to<winrt::Windows::Storage::StorageFile>(args, 2);

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

    static PyObject* AppRecordingManager_SaveScreenshotToFilesAsync(py::wrapper::Windows::Media::AppRecording::AppRecordingManager* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 4)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.AppRecording.AppRecordingManager", L"SaveScreenshotToFilesAsync", 4))
            {
                py::set_arg_count_version_error(4);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Storage::StorageFolder>(args, 0);
                auto param1 = py::convert_to<winrt::hstring>(args, 1);
                auto param2 = py::convert_to<winrt::Windows::Media::AppRecording::AppRecordingSaveScreenshotOption>(args, 2);
                auto param3 = py::convert_to<winrt::Windows::Foundation::Collections::IIterable<winrt::hstring>>(args, 3);

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

    static PyObject* AppRecordingManager_StartRecordingToFileAsync(py::wrapper::Windows::Media::AppRecording::AppRecordingManager* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.AppRecording.AppRecordingManager", L"StartRecordingToFileAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Storage::StorageFile>(args, 0);

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

    static PyObject* AppRecordingManager_get_SupportedScreenshotMediaEncodingSubtypes(py::wrapper::Windows::Media::AppRecording::AppRecordingManager* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingManager", L"SupportedScreenshotMediaEncodingSubtypes"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* _assign_array_AppRecordingManager(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::AppRecording::AppRecordingManager>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_AppRecordingManager(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::AppRecording::AppRecordingManager>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_AppRecordingManager[] = {
        { "get_status", reinterpret_cast<PyCFunction>(AppRecordingManager_GetStatus), METH_VARARGS, nullptr },
        { "record_time_span_to_file_async", reinterpret_cast<PyCFunction>(AppRecordingManager_RecordTimeSpanToFileAsync), METH_VARARGS, nullptr },
        { "save_screenshot_to_files_async", reinterpret_cast<PyCFunction>(AppRecordingManager_SaveScreenshotToFilesAsync), METH_VARARGS, nullptr },
        { "start_recording_to_file_async", reinterpret_cast<PyCFunction>(AppRecordingManager_StartRecordingToFileAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_AppRecordingManager, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_AppRecordingManager), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_AppRecordingManager[] = {
        { "supported_screenshot_media_encoding_subtypes", reinterpret_cast<getter>(AppRecordingManager_get_SupportedScreenshotMediaEncodingSubtypes), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_AppRecordingManager[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_AppRecordingManager) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_AppRecordingManager) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_AppRecordingManager) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_AppRecordingManager) },
        { },
    };

    static PyType_Spec type_spec_AppRecordingManager =
    {
        "winrt._winrt_windows_media_apprecording.AppRecordingManager",
        sizeof(py::wrapper::Windows::Media::AppRecording::AppRecordingManager),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_AppRecordingManager
    };

    static PyGetSetDef getset_AppRecordingManager_Static[] = {
        { }
    };

    static PyMethodDef methods_AppRecordingManager_Static[] = {
        { "get_default", reinterpret_cast<PyCFunction>(AppRecordingManager_GetDefault), METH_VARARGS, nullptr },
        { }
    };

    static PyType_Slot type_slots_AppRecordingManager_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_AppRecordingManager_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_AppRecordingManager_Static) },
        { }
    };

    static PyType_Spec type_spec_AppRecordingManager_Static =
    {
        "winrt._winrt_windows_media_apprecording.AppRecordingManager_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_AppRecordingManager_Static
    };

    // ----- AppRecordingResult class --------------------

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

    static void _dealloc_AppRecordingResult(py::wrapper::Windows::Media::AppRecording::AppRecordingResult* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* AppRecordingResult_get_Duration(py::wrapper::Windows::Media::AppRecording::AppRecordingResult* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingResult", L"Duration"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AppRecordingResult_get_ExtendedError(py::wrapper::Windows::Media::AppRecording::AppRecordingResult* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingResult", L"ExtendedError"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AppRecordingResult_get_IsFileTruncated(py::wrapper::Windows::Media::AppRecording::AppRecordingResult* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingResult", L"IsFileTruncated"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AppRecordingResult_get_Succeeded(py::wrapper::Windows::Media::AppRecording::AppRecordingResult* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingResult", L"Succeeded"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* _assign_array_AppRecordingResult(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::AppRecording::AppRecordingResult>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_AppRecordingResult(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::AppRecording::AppRecordingResult>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_AppRecordingResult[] = {
        { "_assign_array_", _assign_array_AppRecordingResult, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_AppRecordingResult), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_AppRecordingResult[] = {
        { "duration", reinterpret_cast<getter>(AppRecordingResult_get_Duration), nullptr, nullptr, nullptr },
        { "extended_error", reinterpret_cast<getter>(AppRecordingResult_get_ExtendedError), nullptr, nullptr, nullptr },
        { "is_file_truncated", reinterpret_cast<getter>(AppRecordingResult_get_IsFileTruncated), nullptr, nullptr, nullptr },
        { "succeeded", reinterpret_cast<getter>(AppRecordingResult_get_Succeeded), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_AppRecordingResult[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_AppRecordingResult) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_AppRecordingResult) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_AppRecordingResult) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_AppRecordingResult) },
        { },
    };

    static PyType_Spec type_spec_AppRecordingResult =
    {
        "winrt._winrt_windows_media_apprecording.AppRecordingResult",
        sizeof(py::wrapper::Windows::Media::AppRecording::AppRecordingResult),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_AppRecordingResult
    };

    // ----- AppRecordingSaveScreenshotResult class --------------------

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

    static void _dealloc_AppRecordingSaveScreenshotResult(py::wrapper::Windows::Media::AppRecording::AppRecordingSaveScreenshotResult* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* AppRecordingSaveScreenshotResult_get_ExtendedError(py::wrapper::Windows::Media::AppRecording::AppRecordingSaveScreenshotResult* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingSaveScreenshotResult", L"ExtendedError"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AppRecordingSaveScreenshotResult_get_SavedScreenshotInfos(py::wrapper::Windows::Media::AppRecording::AppRecordingSaveScreenshotResult* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingSaveScreenshotResult", L"SavedScreenshotInfos"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AppRecordingSaveScreenshotResult_get_Succeeded(py::wrapper::Windows::Media::AppRecording::AppRecordingSaveScreenshotResult* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingSaveScreenshotResult", L"Succeeded"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* _assign_array_AppRecordingSaveScreenshotResult(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::AppRecording::AppRecordingSaveScreenshotResult>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_AppRecordingSaveScreenshotResult(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::AppRecording::AppRecordingSaveScreenshotResult>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_AppRecordingSaveScreenshotResult[] = {
        { "_assign_array_", _assign_array_AppRecordingSaveScreenshotResult, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_AppRecordingSaveScreenshotResult), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_AppRecordingSaveScreenshotResult[] = {
        { "extended_error", reinterpret_cast<getter>(AppRecordingSaveScreenshotResult_get_ExtendedError), nullptr, nullptr, nullptr },
        { "saved_screenshot_infos", reinterpret_cast<getter>(AppRecordingSaveScreenshotResult_get_SavedScreenshotInfos), nullptr, nullptr, nullptr },
        { "succeeded", reinterpret_cast<getter>(AppRecordingSaveScreenshotResult_get_Succeeded), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_AppRecordingSaveScreenshotResult[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_AppRecordingSaveScreenshotResult) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_AppRecordingSaveScreenshotResult) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_AppRecordingSaveScreenshotResult) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_AppRecordingSaveScreenshotResult) },
        { },
    };

    static PyType_Spec type_spec_AppRecordingSaveScreenshotResult =
    {
        "winrt._winrt_windows_media_apprecording.AppRecordingSaveScreenshotResult",
        sizeof(py::wrapper::Windows::Media::AppRecording::AppRecordingSaveScreenshotResult),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_AppRecordingSaveScreenshotResult
    };

    // ----- AppRecordingSavedScreenshotInfo class --------------------

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

    static void _dealloc_AppRecordingSavedScreenshotInfo(py::wrapper::Windows::Media::AppRecording::AppRecordingSavedScreenshotInfo* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* AppRecordingSavedScreenshotInfo_get_File(py::wrapper::Windows::Media::AppRecording::AppRecordingSavedScreenshotInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingSavedScreenshotInfo", L"File"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AppRecordingSavedScreenshotInfo_get_MediaEncodingSubtype(py::wrapper::Windows::Media::AppRecording::AppRecordingSavedScreenshotInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingSavedScreenshotInfo", L"MediaEncodingSubtype"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* _assign_array_AppRecordingSavedScreenshotInfo(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::AppRecording::AppRecordingSavedScreenshotInfo>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_AppRecordingSavedScreenshotInfo(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::AppRecording::AppRecordingSavedScreenshotInfo>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_AppRecordingSavedScreenshotInfo[] = {
        { "_assign_array_", _assign_array_AppRecordingSavedScreenshotInfo, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_AppRecordingSavedScreenshotInfo), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_AppRecordingSavedScreenshotInfo[] = {
        { "file", reinterpret_cast<getter>(AppRecordingSavedScreenshotInfo_get_File), nullptr, nullptr, nullptr },
        { "media_encoding_subtype", reinterpret_cast<getter>(AppRecordingSavedScreenshotInfo_get_MediaEncodingSubtype), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_AppRecordingSavedScreenshotInfo[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_AppRecordingSavedScreenshotInfo) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_AppRecordingSavedScreenshotInfo) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_AppRecordingSavedScreenshotInfo) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_AppRecordingSavedScreenshotInfo) },
        { },
    };

    static PyType_Spec type_spec_AppRecordingSavedScreenshotInfo =
    {
        "winrt._winrt_windows_media_apprecording.AppRecordingSavedScreenshotInfo",
        sizeof(py::wrapper::Windows::Media::AppRecording::AppRecordingSavedScreenshotInfo),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_AppRecordingSavedScreenshotInfo
    };

    // ----- AppRecordingStatus class --------------------

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

    static void _dealloc_AppRecordingStatus(py::wrapper::Windows::Media::AppRecording::AppRecordingStatus* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* AppRecordingStatus_get_CanRecord(py::wrapper::Windows::Media::AppRecording::AppRecordingStatus* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingStatus", L"CanRecord"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AppRecordingStatus_get_CanRecordTimeSpan(py::wrapper::Windows::Media::AppRecording::AppRecordingStatus* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingStatus", L"CanRecordTimeSpan"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AppRecordingStatus_get_Details(py::wrapper::Windows::Media::AppRecording::AppRecordingStatus* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingStatus", L"Details"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AppRecordingStatus_get_HistoricalBufferDuration(py::wrapper::Windows::Media::AppRecording::AppRecordingStatus* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingStatus", L"HistoricalBufferDuration"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* _assign_array_AppRecordingStatus(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::AppRecording::AppRecordingStatus>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_AppRecordingStatus(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::AppRecording::AppRecordingStatus>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_AppRecordingStatus[] = {
        { "_assign_array_", _assign_array_AppRecordingStatus, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_AppRecordingStatus), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_AppRecordingStatus[] = {
        { "can_record", reinterpret_cast<getter>(AppRecordingStatus_get_CanRecord), nullptr, nullptr, nullptr },
        { "can_record_time_span", reinterpret_cast<getter>(AppRecordingStatus_get_CanRecordTimeSpan), nullptr, nullptr, nullptr },
        { "details", reinterpret_cast<getter>(AppRecordingStatus_get_Details), nullptr, nullptr, nullptr },
        { "historical_buffer_duration", reinterpret_cast<getter>(AppRecordingStatus_get_HistoricalBufferDuration), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_AppRecordingStatus[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_AppRecordingStatus) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_AppRecordingStatus) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_AppRecordingStatus) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_AppRecordingStatus) },
        { },
    };

    static PyType_Spec type_spec_AppRecordingStatus =
    {
        "winrt._winrt_windows_media_apprecording.AppRecordingStatus",
        sizeof(py::wrapper::Windows::Media::AppRecording::AppRecordingStatus),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_AppRecordingStatus
    };

    // ----- AppRecordingStatusDetails class --------------------

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

    static void _dealloc_AppRecordingStatusDetails(py::wrapper::Windows::Media::AppRecording::AppRecordingStatusDetails* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* AppRecordingStatusDetails_get_IsAnyAppBroadcasting(py::wrapper::Windows::Media::AppRecording::AppRecordingStatusDetails* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingStatusDetails", L"IsAnyAppBroadcasting"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AppRecordingStatusDetails_get_IsAppInactive(py::wrapper::Windows::Media::AppRecording::AppRecordingStatusDetails* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingStatusDetails", L"IsAppInactive"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AppRecordingStatusDetails_get_IsBlockedForApp(py::wrapper::Windows::Media::AppRecording::AppRecordingStatusDetails* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingStatusDetails", L"IsBlockedForApp"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AppRecordingStatusDetails_get_IsCaptureResourceUnavailable(py::wrapper::Windows::Media::AppRecording::AppRecordingStatusDetails* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingStatusDetails", L"IsCaptureResourceUnavailable"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AppRecordingStatusDetails_get_IsDisabledBySystem(py::wrapper::Windows::Media::AppRecording::AppRecordingStatusDetails* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingStatusDetails", L"IsDisabledBySystem"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AppRecordingStatusDetails_get_IsDisabledByUser(py::wrapper::Windows::Media::AppRecording::AppRecordingStatusDetails* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingStatusDetails", L"IsDisabledByUser"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AppRecordingStatusDetails_get_IsGameStreamInProgress(py::wrapper::Windows::Media::AppRecording::AppRecordingStatusDetails* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingStatusDetails", L"IsGameStreamInProgress"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AppRecordingStatusDetails_get_IsGpuConstrained(py::wrapper::Windows::Media::AppRecording::AppRecordingStatusDetails* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingStatusDetails", L"IsGpuConstrained"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* AppRecordingStatusDetails_get_IsTimeSpanRecordingDisabled(py::wrapper::Windows::Media::AppRecording::AppRecordingStatusDetails* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.AppRecording.AppRecordingStatusDetails", L"IsTimeSpanRecordingDisabled"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* _assign_array_AppRecordingStatusDetails(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::AppRecording::AppRecordingStatusDetails>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_AppRecordingStatusDetails(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::AppRecording::AppRecordingStatusDetails>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_AppRecordingStatusDetails[] = {
        { "_assign_array_", _assign_array_AppRecordingStatusDetails, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_AppRecordingStatusDetails), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_AppRecordingStatusDetails[] = {
        { "is_any_app_broadcasting", reinterpret_cast<getter>(AppRecordingStatusDetails_get_IsAnyAppBroadcasting), nullptr, nullptr, nullptr },
        { "is_app_inactive", reinterpret_cast<getter>(AppRecordingStatusDetails_get_IsAppInactive), nullptr, nullptr, nullptr },
        { "is_blocked_for_app", reinterpret_cast<getter>(AppRecordingStatusDetails_get_IsBlockedForApp), nullptr, nullptr, nullptr },
        { "is_capture_resource_unavailable", reinterpret_cast<getter>(AppRecordingStatusDetails_get_IsCaptureResourceUnavailable), nullptr, nullptr, nullptr },
        { "is_disabled_by_system", reinterpret_cast<getter>(AppRecordingStatusDetails_get_IsDisabledBySystem), nullptr, nullptr, nullptr },
        { "is_disabled_by_user", reinterpret_cast<getter>(AppRecordingStatusDetails_get_IsDisabledByUser), nullptr, nullptr, nullptr },
        { "is_game_stream_in_progress", reinterpret_cast<getter>(AppRecordingStatusDetails_get_IsGameStreamInProgress), nullptr, nullptr, nullptr },
        { "is_gpu_constrained", reinterpret_cast<getter>(AppRecordingStatusDetails_get_IsGpuConstrained), nullptr, nullptr, nullptr },
        { "is_time_span_recording_disabled", reinterpret_cast<getter>(AppRecordingStatusDetails_get_IsTimeSpanRecordingDisabled), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_AppRecordingStatusDetails[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_AppRecordingStatusDetails) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_AppRecordingStatusDetails) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_AppRecordingStatusDetails) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_AppRecordingStatusDetails) },
        { },
    };

    static PyType_Spec type_spec_AppRecordingStatusDetails =
    {
        "winrt._winrt_windows_media_apprecording.AppRecordingStatusDetails",
        sizeof(py::wrapper::Windows::Media::AppRecording::AppRecordingStatusDetails),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_AppRecordingStatusDetails
    };

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


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

} // py::cpp::Windows::Media::AppRecording

PyMODINIT_FUNC PyInit__winrt_windows_media_apprecording(void) noexcept
{
    using namespace py::cpp::Windows::Media::AppRecording;

    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_AppRecordingManager_Static{PyType_FromSpec(&type_spec_AppRecordingManager_Static)};
    if (!type_AppRecordingManager_Static)
    {
        return nullptr;
    }

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

    if (py::register_python_type(module.get(), &type_spec_AppRecordingResult, object_bases.get(), nullptr) == -1)
    {
        return nullptr;
    }

    if (py::register_python_type(module.get(), &type_spec_AppRecordingSaveScreenshotResult, object_bases.get(), nullptr) == -1)
    {
        return nullptr;
    }

    if (py::register_python_type(module.get(), &type_spec_AppRecordingSavedScreenshotInfo, object_bases.get(), nullptr) == -1)
    {
        return nullptr;
    }

    if (py::register_python_type(module.get(), &type_spec_AppRecordingStatus, object_bases.get(), nullptr) == -1)
    {
        return nullptr;
    }

    if (py::register_python_type(module.get(), &type_spec_AppRecordingStatusDetails, object_bases.get(), nullptr) == -1)
    {
        return nullptr;
    }


    return module.detach();
}
