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

#include "py.Windows.Graphics.Printing.h"

namespace py::cpp::Windows::Graphics::Printing
{
    // ----- PrintManager class --------------------

    static PyObject* _new_PrintManager(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Graphics::Printing::PrintManager>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Graphics::Printing::PrintManager>::type_name);
        return nullptr;
    }

    static void _dealloc_PrintManager(py::wrapper::Windows::Graphics::Printing::PrintManager* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PrintManager_GetForCurrentView(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 0)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Printing.PrintManager", L"GetForCurrentView", 0);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return winrt::Windows::Graphics::Printing::PrintManager::GetForCurrentView();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PrintManager_IsSupported(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 0)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Printing.PrintManager", L"IsSupported", 0);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return winrt::Windows::Graphics::Printing::PrintManager::IsSupported();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PrintManager_ShowPrintUIAsync(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 0)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Printing.PrintManager", L"ShowPrintUIAsync", 0);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return winrt::Windows::Graphics::Printing::PrintManager::ShowPrintUIAsync();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PrintManager_add_PrintTaskRequested(py::wrapper::Windows::Graphics::Printing::PrintManager* self, PyObject* arg) noexcept
    {
        try
        {
            static std::optional<bool> is_event_present{};

            if (!is_event_present.has_value())
            {
                is_event_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Printing.PrintManager", L"PrintTaskRequested");
            }

            if (!is_event_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
                return nullptr;
            }

            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Graphics::Printing::PrintManager, winrt::Windows::Graphics::Printing::PrintTaskRequestedEventArgs>>(arg);

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.PrintTaskRequested(param0);
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintManager_remove_PrintTaskRequested(py::wrapper::Windows::Graphics::Printing::PrintManager* self, PyObject* arg) noexcept
    {
        try
        {
            static std::optional<bool> is_event_present{};

            if (!is_event_present.has_value())
            {
                is_event_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Printing.PrintManager", L"PrintTaskRequested");
            }

            if (!is_event_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
                return nullptr;
            }

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

            {
                auto _gil = release_gil();
                self->obj.PrintTaskRequested(param0);
            }

            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_PrintManager(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Graphics::Printing::PrintManager>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PrintManager[] = {
        { "add_print_task_requested", reinterpret_cast<PyCFunction>(PrintManager_add_PrintTaskRequested), METH_O, nullptr },
        { "remove_print_task_requested", reinterpret_cast<PyCFunction>(PrintManager_remove_PrintTaskRequested), METH_O, nullptr },
        { "_assign_array_", _assign_array_PrintManager, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PrintManager), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_PrintManager[] = {
        { }};

    static PyType_Slot _type_slots_PrintManager[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintManager) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PrintManager) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintManager) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintManager) },
        { }};

    static PyType_Spec type_spec_PrintManager = {
        "winrt._winrt_windows_graphics_printing.PrintManager",
        sizeof(py::wrapper::Windows::Graphics::Printing::PrintManager),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintManager};

    static PyGetSetDef getset_PrintManager_Static[] = {
        { }};

    static PyMethodDef methods_PrintManager_Static[] = {
        { "get_for_current_view", reinterpret_cast<PyCFunction>(PrintManager_GetForCurrentView), METH_VARARGS, nullptr },
        { "is_supported", reinterpret_cast<PyCFunction>(PrintManager_IsSupported), METH_VARARGS, nullptr },
        { "show_print_ui_async", reinterpret_cast<PyCFunction>(PrintManager_ShowPrintUIAsync), METH_VARARGS, nullptr },
        { }};

    static PyType_Slot type_slots_PrintManager_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_PrintManager_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_PrintManager_Static) },
        { }
    };

    static PyType_Spec type_spec_PrintManager_Static = {
        "winrt._winrt_windows_graphics_printing.PrintManager_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_PrintManager_Static};

    // ----- PrintPageInfo class --------------------

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

        auto arg_count = PyTuple_GET_SIZE(args);
        if (arg_count == 0)
        {
            try
            {
                winrt::Windows::Graphics::Printing::PrintPageInfo 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_PrintPageInfo(py::wrapper::Windows::Graphics::Printing::PrintPageInfo* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PrintPageInfo_get_PageSize(py::wrapper::Windows::Graphics::Printing::PrintPageInfo* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintPageInfo", L"PageSize");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.PageSize();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintPageInfo_put_PageSize(py::wrapper::Windows::Graphics::Printing::PrintPageInfo* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintPageInfo", L"PageSize");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Foundation::Size>(arg);

            {
                auto _gil = release_gil();
                self->obj.PageSize(param0);
            }

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

    static PyObject* PrintPageInfo_get_Orientation(py::wrapper::Windows::Graphics::Printing::PrintPageInfo* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintPageInfo", L"Orientation");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Orientation();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintPageInfo_put_Orientation(py::wrapper::Windows::Graphics::Printing::PrintPageInfo* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintPageInfo", L"Orientation");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintOrientation>(arg);

            {
                auto _gil = release_gil();
                self->obj.Orientation(param0);
            }

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

    static PyObject* PrintPageInfo_get_MediaSize(py::wrapper::Windows::Graphics::Printing::PrintPageInfo* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintPageInfo", L"MediaSize");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.MediaSize();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintPageInfo_put_MediaSize(py::wrapper::Windows::Graphics::Printing::PrintPageInfo* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintPageInfo", L"MediaSize");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintMediaSize>(arg);

            {
                auto _gil = release_gil();
                self->obj.MediaSize(param0);
            }

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

    static PyObject* PrintPageInfo_get_DpiY(py::wrapper::Windows::Graphics::Printing::PrintPageInfo* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintPageInfo", L"DpiY");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.DpiY();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintPageInfo_put_DpiY(py::wrapper::Windows::Graphics::Printing::PrintPageInfo* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintPageInfo", L"DpiY");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<uint32_t>(arg);

            {
                auto _gil = release_gil();
                self->obj.DpiY(param0);
            }

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

    static PyObject* PrintPageInfo_get_DpiX(py::wrapper::Windows::Graphics::Printing::PrintPageInfo* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintPageInfo", L"DpiX");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.DpiX();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintPageInfo_put_DpiX(py::wrapper::Windows::Graphics::Printing::PrintPageInfo* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintPageInfo", L"DpiX");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<uint32_t>(arg);

            {
                auto _gil = release_gil();
                self->obj.DpiX(param0);
            }

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

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

    static PyObject* _from_PrintPageInfo(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Graphics::Printing::PrintPageInfo>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PrintPageInfo[] = {
        { "_assign_array_", _assign_array_PrintPageInfo, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PrintPageInfo), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_PrintPageInfo[] = {
        { "page_size", reinterpret_cast<getter>(PrintPageInfo_get_PageSize), reinterpret_cast<setter>(PrintPageInfo_put_PageSize), nullptr, nullptr },
        { "orientation", reinterpret_cast<getter>(PrintPageInfo_get_Orientation), reinterpret_cast<setter>(PrintPageInfo_put_Orientation), nullptr, nullptr },
        { "media_size", reinterpret_cast<getter>(PrintPageInfo_get_MediaSize), reinterpret_cast<setter>(PrintPageInfo_put_MediaSize), nullptr, nullptr },
        { "dpi_y", reinterpret_cast<getter>(PrintPageInfo_get_DpiY), reinterpret_cast<setter>(PrintPageInfo_put_DpiY), nullptr, nullptr },
        { "dpi_x", reinterpret_cast<getter>(PrintPageInfo_get_DpiX), reinterpret_cast<setter>(PrintPageInfo_put_DpiX), nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_PrintPageInfo[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintPageInfo) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PrintPageInfo) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintPageInfo) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintPageInfo) },
        { }};

    static PyType_Spec type_spec_PrintPageInfo = {
        "winrt._winrt_windows_graphics_printing.PrintPageInfo",
        sizeof(py::wrapper::Windows::Graphics::Printing::PrintPageInfo),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintPageInfo};

    // ----- PrintPageRange class --------------------

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

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

                winrt::Windows::Graphics::Printing::PrintPageRange instance{param0, param1};
                return py::wrap(instance, type);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<int32_t>(args, 0);

                winrt::Windows::Graphics::Printing::PrintPageRange 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_PrintPageRange(py::wrapper::Windows::Graphics::Printing::PrintPageRange* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PrintPageRange_get_FirstPageNumber(py::wrapper::Windows::Graphics::Printing::PrintPageRange* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintPageRange", L"FirstPageNumber");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.FirstPageNumber();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintPageRange_get_LastPageNumber(py::wrapper::Windows::Graphics::Printing::PrintPageRange* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintPageRange", L"LastPageNumber");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.LastPageNumber();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_PrintPageRange(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Graphics::Printing::PrintPageRange>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PrintPageRange[] = {
        { "_assign_array_", _assign_array_PrintPageRange, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PrintPageRange), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_PrintPageRange[] = {
        { "first_page_number", reinterpret_cast<getter>(PrintPageRange_get_FirstPageNumber), nullptr, nullptr, nullptr },
        { "last_page_number", reinterpret_cast<getter>(PrintPageRange_get_LastPageNumber), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_PrintPageRange[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintPageRange) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PrintPageRange) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintPageRange) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintPageRange) },
        { }};

    static PyType_Spec type_spec_PrintPageRange = {
        "winrt._winrt_windows_graphics_printing.PrintPageRange",
        sizeof(py::wrapper::Windows::Graphics::Printing::PrintPageRange),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintPageRange};

    // ----- PrintPageRangeOptions class --------------------

    static PyObject* _new_PrintPageRangeOptions(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Graphics::Printing::PrintPageRangeOptions>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Graphics::Printing::PrintPageRangeOptions>::type_name);
        return nullptr;
    }

    static void _dealloc_PrintPageRangeOptions(py::wrapper::Windows::Graphics::Printing::PrintPageRangeOptions* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PrintPageRangeOptions_get_AllowCustomSetOfPages(py::wrapper::Windows::Graphics::Printing::PrintPageRangeOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintPageRangeOptions", L"AllowCustomSetOfPages");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.AllowCustomSetOfPages();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintPageRangeOptions_put_AllowCustomSetOfPages(py::wrapper::Windows::Graphics::Printing::PrintPageRangeOptions* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintPageRangeOptions", L"AllowCustomSetOfPages");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<bool>(arg);

            {
                auto _gil = release_gil();
                self->obj.AllowCustomSetOfPages(param0);
            }

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

    static PyObject* PrintPageRangeOptions_get_AllowCurrentPage(py::wrapper::Windows::Graphics::Printing::PrintPageRangeOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintPageRangeOptions", L"AllowCurrentPage");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.AllowCurrentPage();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintPageRangeOptions_put_AllowCurrentPage(py::wrapper::Windows::Graphics::Printing::PrintPageRangeOptions* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintPageRangeOptions", L"AllowCurrentPage");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<bool>(arg);

            {
                auto _gil = release_gil();
                self->obj.AllowCurrentPage(param0);
            }

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

    static PyObject* PrintPageRangeOptions_get_AllowAllPages(py::wrapper::Windows::Graphics::Printing::PrintPageRangeOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintPageRangeOptions", L"AllowAllPages");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.AllowAllPages();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintPageRangeOptions_put_AllowAllPages(py::wrapper::Windows::Graphics::Printing::PrintPageRangeOptions* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintPageRangeOptions", L"AllowAllPages");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<bool>(arg);

            {
                auto _gil = release_gil();
                self->obj.AllowAllPages(param0);
            }

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

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

    static PyObject* _from_PrintPageRangeOptions(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Graphics::Printing::PrintPageRangeOptions>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PrintPageRangeOptions[] = {
        { "_assign_array_", _assign_array_PrintPageRangeOptions, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PrintPageRangeOptions), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_PrintPageRangeOptions[] = {
        { "allow_custom_set_of_pages", reinterpret_cast<getter>(PrintPageRangeOptions_get_AllowCustomSetOfPages), reinterpret_cast<setter>(PrintPageRangeOptions_put_AllowCustomSetOfPages), nullptr, nullptr },
        { "allow_current_page", reinterpret_cast<getter>(PrintPageRangeOptions_get_AllowCurrentPage), reinterpret_cast<setter>(PrintPageRangeOptions_put_AllowCurrentPage), nullptr, nullptr },
        { "allow_all_pages", reinterpret_cast<getter>(PrintPageRangeOptions_get_AllowAllPages), reinterpret_cast<setter>(PrintPageRangeOptions_put_AllowAllPages), nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_PrintPageRangeOptions[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintPageRangeOptions) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PrintPageRangeOptions) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintPageRangeOptions) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintPageRangeOptions) },
        { }};

    static PyType_Spec type_spec_PrintPageRangeOptions = {
        "winrt._winrt_windows_graphics_printing.PrintPageRangeOptions",
        sizeof(py::wrapper::Windows::Graphics::Printing::PrintPageRangeOptions),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintPageRangeOptions};

    // ----- PrintTask class --------------------

    static PyObject* _new_PrintTask(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Graphics::Printing::PrintTask>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Graphics::Printing::PrintTask>::type_name);
        return nullptr;
    }

    static void _dealloc_PrintTask(py::wrapper::Windows::Graphics::Printing::PrintTask* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PrintTask_get_Options(py::wrapper::Windows::Graphics::Printing::PrintTask* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTask", L"Options");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Options();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintTask_get_Properties(py::wrapper::Windows::Graphics::Printing::PrintTask* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTask", L"Properties");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Properties();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintTask_get_Source(py::wrapper::Windows::Graphics::Printing::PrintTask* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTask", L"Source");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Source();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintTask_get_IsPreviewEnabled(py::wrapper::Windows::Graphics::Printing::PrintTask* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTask", L"IsPreviewEnabled");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.IsPreviewEnabled();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintTask_put_IsPreviewEnabled(py::wrapper::Windows::Graphics::Printing::PrintTask* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTask", L"IsPreviewEnabled");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<bool>(arg);

            {
                auto _gil = release_gil();
                self->obj.IsPreviewEnabled(param0);
            }

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

    static PyObject* PrintTask_get_IsPrinterTargetEnabled(py::wrapper::Windows::Graphics::Printing::PrintTask* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTask", L"IsPrinterTargetEnabled");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.IsPrinterTargetEnabled();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintTask_put_IsPrinterTargetEnabled(py::wrapper::Windows::Graphics::Printing::PrintTask* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTask", L"IsPrinterTargetEnabled");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<bool>(arg);

            {
                auto _gil = release_gil();
                self->obj.IsPrinterTargetEnabled(param0);
            }

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

    static PyObject* PrintTask_get_Is3DManufacturingTargetEnabled(py::wrapper::Windows::Graphics::Printing::PrintTask* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTask", L"Is3DManufacturingTargetEnabled");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Is3DManufacturingTargetEnabled();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintTask_put_Is3DManufacturingTargetEnabled(py::wrapper::Windows::Graphics::Printing::PrintTask* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTask", L"Is3DManufacturingTargetEnabled");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<bool>(arg);

            {
                auto _gil = release_gil();
                self->obj.Is3DManufacturingTargetEnabled(param0);
            }

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

    static PyObject* PrintTask_add_Completed(py::wrapper::Windows::Graphics::Printing::PrintTask* self, PyObject* arg) noexcept
    {
        try
        {
            static std::optional<bool> is_event_present{};

            if (!is_event_present.has_value())
            {
                is_event_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Printing.PrintTask", L"Completed");
            }

            if (!is_event_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
                return nullptr;
            }

            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Graphics::Printing::PrintTask, winrt::Windows::Graphics::Printing::PrintTaskCompletedEventArgs>>(arg);

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Completed(param0);
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintTask_remove_Completed(py::wrapper::Windows::Graphics::Printing::PrintTask* self, PyObject* arg) noexcept
    {
        try
        {
            static std::optional<bool> is_event_present{};

            if (!is_event_present.has_value())
            {
                is_event_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Printing.PrintTask", L"Completed");
            }

            if (!is_event_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
                return nullptr;
            }

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

            {
                auto _gil = release_gil();
                self->obj.Completed(param0);
            }

            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintTask_add_Previewing(py::wrapper::Windows::Graphics::Printing::PrintTask* self, PyObject* arg) noexcept
    {
        try
        {
            static std::optional<bool> is_event_present{};

            if (!is_event_present.has_value())
            {
                is_event_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Printing.PrintTask", L"Previewing");
            }

            if (!is_event_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
                return nullptr;
            }

            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Graphics::Printing::PrintTask, winrt::Windows::Foundation::IInspectable>>(arg);

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Previewing(param0);
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintTask_remove_Previewing(py::wrapper::Windows::Graphics::Printing::PrintTask* self, PyObject* arg) noexcept
    {
        try
        {
            static std::optional<bool> is_event_present{};

            if (!is_event_present.has_value())
            {
                is_event_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Printing.PrintTask", L"Previewing");
            }

            if (!is_event_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
                return nullptr;
            }

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

            {
                auto _gil = release_gil();
                self->obj.Previewing(param0);
            }

            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintTask_add_Progressing(py::wrapper::Windows::Graphics::Printing::PrintTask* self, PyObject* arg) noexcept
    {
        try
        {
            static std::optional<bool> is_event_present{};

            if (!is_event_present.has_value())
            {
                is_event_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Printing.PrintTask", L"Progressing");
            }

            if (!is_event_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
                return nullptr;
            }

            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Graphics::Printing::PrintTask, winrt::Windows::Graphics::Printing::PrintTaskProgressingEventArgs>>(arg);

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Progressing(param0);
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintTask_remove_Progressing(py::wrapper::Windows::Graphics::Printing::PrintTask* self, PyObject* arg) noexcept
    {
        try
        {
            static std::optional<bool> is_event_present{};

            if (!is_event_present.has_value())
            {
                is_event_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Printing.PrintTask", L"Progressing");
            }

            if (!is_event_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
                return nullptr;
            }

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

            {
                auto _gil = release_gil();
                self->obj.Progressing(param0);
            }

            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintTask_add_Submitting(py::wrapper::Windows::Graphics::Printing::PrintTask* self, PyObject* arg) noexcept
    {
        try
        {
            static std::optional<bool> is_event_present{};

            if (!is_event_present.has_value())
            {
                is_event_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Printing.PrintTask", L"Submitting");
            }

            if (!is_event_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
                return nullptr;
            }

            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Graphics::Printing::PrintTask, winrt::Windows::Foundation::IInspectable>>(arg);

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Submitting(param0);
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintTask_remove_Submitting(py::wrapper::Windows::Graphics::Printing::PrintTask* self, PyObject* arg) noexcept
    {
        try
        {
            static std::optional<bool> is_event_present{};

            if (!is_event_present.has_value())
            {
                is_event_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Graphics.Printing.PrintTask", L"Submitting");
            }

            if (!is_event_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
                return nullptr;
            }

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

            {
                auto _gil = release_gil();
                self->obj.Submitting(param0);
            }

            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_PrintTask(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Graphics::Printing::PrintTask>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PrintTask[] = {
        { "add_completed", reinterpret_cast<PyCFunction>(PrintTask_add_Completed), METH_O, nullptr },
        { "remove_completed", reinterpret_cast<PyCFunction>(PrintTask_remove_Completed), METH_O, nullptr },
        { "add_previewing", reinterpret_cast<PyCFunction>(PrintTask_add_Previewing), METH_O, nullptr },
        { "remove_previewing", reinterpret_cast<PyCFunction>(PrintTask_remove_Previewing), METH_O, nullptr },
        { "add_progressing", reinterpret_cast<PyCFunction>(PrintTask_add_Progressing), METH_O, nullptr },
        { "remove_progressing", reinterpret_cast<PyCFunction>(PrintTask_remove_Progressing), METH_O, nullptr },
        { "add_submitting", reinterpret_cast<PyCFunction>(PrintTask_add_Submitting), METH_O, nullptr },
        { "remove_submitting", reinterpret_cast<PyCFunction>(PrintTask_remove_Submitting), METH_O, nullptr },
        { "_assign_array_", _assign_array_PrintTask, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PrintTask), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_PrintTask[] = {
        { "options", reinterpret_cast<getter>(PrintTask_get_Options), nullptr, nullptr, nullptr },
        { "properties", reinterpret_cast<getter>(PrintTask_get_Properties), nullptr, nullptr, nullptr },
        { "source", reinterpret_cast<getter>(PrintTask_get_Source), nullptr, nullptr, nullptr },
        { "is_preview_enabled", reinterpret_cast<getter>(PrintTask_get_IsPreviewEnabled), reinterpret_cast<setter>(PrintTask_put_IsPreviewEnabled), nullptr, nullptr },
        { "is_printer_target_enabled", reinterpret_cast<getter>(PrintTask_get_IsPrinterTargetEnabled), reinterpret_cast<setter>(PrintTask_put_IsPrinterTargetEnabled), nullptr, nullptr },
        { "is_3d_manufacturing_target_enabled", reinterpret_cast<getter>(PrintTask_get_Is3DManufacturingTargetEnabled), reinterpret_cast<setter>(PrintTask_put_Is3DManufacturingTargetEnabled), nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_PrintTask[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintTask) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PrintTask) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintTask) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintTask) },
        { }};

    static PyType_Spec type_spec_PrintTask = {
        "winrt._winrt_windows_graphics_printing.PrintTask",
        sizeof(py::wrapper::Windows::Graphics::Printing::PrintTask),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintTask};

    // ----- PrintTaskCompletedEventArgs class --------------------

    static PyObject* _new_PrintTaskCompletedEventArgs(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Graphics::Printing::PrintTaskCompletedEventArgs>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Graphics::Printing::PrintTaskCompletedEventArgs>::type_name);
        return nullptr;
    }

    static void _dealloc_PrintTaskCompletedEventArgs(py::wrapper::Windows::Graphics::Printing::PrintTaskCompletedEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PrintTaskCompletedEventArgs_get_Completion(py::wrapper::Windows::Graphics::Printing::PrintTaskCompletedEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskCompletedEventArgs", L"Completion");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Completion();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_PrintTaskCompletedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Graphics::Printing::PrintTaskCompletedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PrintTaskCompletedEventArgs[] = {
        { "_assign_array_", _assign_array_PrintTaskCompletedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PrintTaskCompletedEventArgs), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_PrintTaskCompletedEventArgs[] = {
        { "completion", reinterpret_cast<getter>(PrintTaskCompletedEventArgs_get_Completion), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_PrintTaskCompletedEventArgs[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintTaskCompletedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PrintTaskCompletedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintTaskCompletedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintTaskCompletedEventArgs) },
        { }};

    static PyType_Spec type_spec_PrintTaskCompletedEventArgs = {
        "winrt._winrt_windows_graphics_printing.PrintTaskCompletedEventArgs",
        sizeof(py::wrapper::Windows::Graphics::Printing::PrintTaskCompletedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintTaskCompletedEventArgs};

    // ----- PrintTaskOptions class --------------------

    static PyObject* _new_PrintTaskOptions(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Graphics::Printing::PrintTaskOptions>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Graphics::Printing::PrintTaskOptions>::type_name);
        return nullptr;
    }

    static void _dealloc_PrintTaskOptions(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PrintTaskOptions_GetPageDescription(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 1)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"GetPageDescription", 1);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<uint32_t>(args, 0);

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.GetPageDescription(param0);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PrintTaskOptions_GetPagePrintTicket(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 1)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"GetPagePrintTicket", 1);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintPageInfo>(args, 0);

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.GetPagePrintTicket(param0);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PrintTaskOptions_get_Bordering(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"Bordering");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Bordering();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintTaskOptions_put_Bordering(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"Bordering");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintBordering>(arg);

            {
                auto _gil = release_gil();
                self->obj.Bordering(param0);
            }

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

    static PyObject* PrintTaskOptions_get_PageRangeOptions(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"PageRangeOptions");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.PageRangeOptions();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintTaskOptions_get_CustomPageRanges(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"CustomPageRanges");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.CustomPageRanges();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintTaskOptions_get_MediaType(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"MediaType");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.MediaType();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintTaskOptions_put_MediaType(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"MediaType");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintMediaType>(arg);

            {
                auto _gil = release_gil();
                self->obj.MediaType(param0);
            }

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

    static PyObject* PrintTaskOptions_get_HolePunch(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"HolePunch");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.HolePunch();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintTaskOptions_put_HolePunch(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"HolePunch");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintHolePunch>(arg);

            {
                auto _gil = release_gil();
                self->obj.HolePunch(param0);
            }

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

    static PyObject* PrintTaskOptions_get_Binding(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"Binding");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Binding();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintTaskOptions_put_Binding(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"Binding");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintBinding>(arg);

            {
                auto _gil = release_gil();
                self->obj.Binding(param0);
            }

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

    static PyObject* PrintTaskOptions_get_Duplex(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"Duplex");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Duplex();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintTaskOptions_put_Duplex(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"Duplex");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintDuplex>(arg);

            {
                auto _gil = release_gil();
                self->obj.Duplex(param0);
            }

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

    static PyObject* PrintTaskOptions_get_ColorMode(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"ColorMode");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.ColorMode();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintTaskOptions_put_ColorMode(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"ColorMode");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintColorMode>(arg);

            {
                auto _gil = release_gil();
                self->obj.ColorMode(param0);
            }

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

    static PyObject* PrintTaskOptions_get_Collation(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"Collation");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Collation();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintTaskOptions_put_Collation(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"Collation");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintCollation>(arg);

            {
                auto _gil = release_gil();
                self->obj.Collation(param0);
            }

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

    static PyObject* PrintTaskOptions_get_Staple(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"Staple");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Staple();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintTaskOptions_put_Staple(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"Staple");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintStaple>(arg);

            {
                auto _gil = release_gil();
                self->obj.Staple(param0);
            }

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

    static PyObject* PrintTaskOptions_get_PrintQuality(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"PrintQuality");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.PrintQuality();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintTaskOptions_put_PrintQuality(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"PrintQuality");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintQuality>(arg);

            {
                auto _gil = release_gil();
                self->obj.PrintQuality(param0);
            }

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

    static PyObject* PrintTaskOptions_get_Orientation(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"Orientation");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Orientation();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintTaskOptions_put_Orientation(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"Orientation");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintOrientation>(arg);

            {
                auto _gil = release_gil();
                self->obj.Orientation(param0);
            }

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

    static PyObject* PrintTaskOptions_get_MediaSize(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"MediaSize");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.MediaSize();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintTaskOptions_put_MediaSize(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"MediaSize");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintMediaSize>(arg);

            {
                auto _gil = release_gil();
                self->obj.MediaSize(param0);
            }

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

    static PyObject* PrintTaskOptions_get_NumberOfCopies(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"NumberOfCopies");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.NumberOfCopies();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintTaskOptions_put_NumberOfCopies(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"NumberOfCopies");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<uint32_t>(arg);

            {
                auto _gil = release_gil();
                self->obj.NumberOfCopies(param0);
            }

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

    static PyObject* PrintTaskOptions_get_MaxCopies(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"MaxCopies");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.MaxCopies();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintTaskOptions_get_MinCopies(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"MinCopies");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.MinCopies();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintTaskOptions_get_DisplayedOptions(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskOptions", L"DisplayedOptions");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.DisplayedOptions();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_PrintTaskOptions(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Graphics::Printing::PrintTaskOptions>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PrintTaskOptions[] = {
        { "get_page_description", reinterpret_cast<PyCFunction>(PrintTaskOptions_GetPageDescription), METH_VARARGS, nullptr },
        { "get_page_print_ticket", reinterpret_cast<PyCFunction>(PrintTaskOptions_GetPagePrintTicket), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_PrintTaskOptions, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PrintTaskOptions), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_PrintTaskOptions[] = {
        { "bordering", reinterpret_cast<getter>(PrintTaskOptions_get_Bordering), reinterpret_cast<setter>(PrintTaskOptions_put_Bordering), nullptr, nullptr },
        { "page_range_options", reinterpret_cast<getter>(PrintTaskOptions_get_PageRangeOptions), nullptr, nullptr, nullptr },
        { "custom_page_ranges", reinterpret_cast<getter>(PrintTaskOptions_get_CustomPageRanges), nullptr, nullptr, nullptr },
        { "media_type", reinterpret_cast<getter>(PrintTaskOptions_get_MediaType), reinterpret_cast<setter>(PrintTaskOptions_put_MediaType), nullptr, nullptr },
        { "hole_punch", reinterpret_cast<getter>(PrintTaskOptions_get_HolePunch), reinterpret_cast<setter>(PrintTaskOptions_put_HolePunch), nullptr, nullptr },
        { "binding", reinterpret_cast<getter>(PrintTaskOptions_get_Binding), reinterpret_cast<setter>(PrintTaskOptions_put_Binding), nullptr, nullptr },
        { "duplex", reinterpret_cast<getter>(PrintTaskOptions_get_Duplex), reinterpret_cast<setter>(PrintTaskOptions_put_Duplex), nullptr, nullptr },
        { "color_mode", reinterpret_cast<getter>(PrintTaskOptions_get_ColorMode), reinterpret_cast<setter>(PrintTaskOptions_put_ColorMode), nullptr, nullptr },
        { "collation", reinterpret_cast<getter>(PrintTaskOptions_get_Collation), reinterpret_cast<setter>(PrintTaskOptions_put_Collation), nullptr, nullptr },
        { "staple", reinterpret_cast<getter>(PrintTaskOptions_get_Staple), reinterpret_cast<setter>(PrintTaskOptions_put_Staple), nullptr, nullptr },
        { "print_quality", reinterpret_cast<getter>(PrintTaskOptions_get_PrintQuality), reinterpret_cast<setter>(PrintTaskOptions_put_PrintQuality), nullptr, nullptr },
        { "orientation", reinterpret_cast<getter>(PrintTaskOptions_get_Orientation), reinterpret_cast<setter>(PrintTaskOptions_put_Orientation), nullptr, nullptr },
        { "media_size", reinterpret_cast<getter>(PrintTaskOptions_get_MediaSize), reinterpret_cast<setter>(PrintTaskOptions_put_MediaSize), nullptr, nullptr },
        { "number_of_copies", reinterpret_cast<getter>(PrintTaskOptions_get_NumberOfCopies), reinterpret_cast<setter>(PrintTaskOptions_put_NumberOfCopies), nullptr, nullptr },
        { "max_copies", reinterpret_cast<getter>(PrintTaskOptions_get_MaxCopies), nullptr, nullptr, nullptr },
        { "min_copies", reinterpret_cast<getter>(PrintTaskOptions_get_MinCopies), nullptr, nullptr, nullptr },
        { "displayed_options", reinterpret_cast<getter>(PrintTaskOptions_get_DisplayedOptions), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_PrintTaskOptions[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintTaskOptions) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PrintTaskOptions) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintTaskOptions) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintTaskOptions) },
        { }};

    static PyType_Spec type_spec_PrintTaskOptions = {
        "winrt._winrt_windows_graphics_printing.PrintTaskOptions",
        sizeof(py::wrapper::Windows::Graphics::Printing::PrintTaskOptions),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintTaskOptions};

    // ----- PrintTaskProgressingEventArgs class --------------------

    static PyObject* _new_PrintTaskProgressingEventArgs(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Graphics::Printing::PrintTaskProgressingEventArgs>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Graphics::Printing::PrintTaskProgressingEventArgs>::type_name);
        return nullptr;
    }

    static void _dealloc_PrintTaskProgressingEventArgs(py::wrapper::Windows::Graphics::Printing::PrintTaskProgressingEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PrintTaskProgressingEventArgs_get_DocumentPageCount(py::wrapper::Windows::Graphics::Printing::PrintTaskProgressingEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskProgressingEventArgs", L"DocumentPageCount");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.DocumentPageCount();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_PrintTaskProgressingEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Graphics::Printing::PrintTaskProgressingEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PrintTaskProgressingEventArgs[] = {
        { "_assign_array_", _assign_array_PrintTaskProgressingEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PrintTaskProgressingEventArgs), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_PrintTaskProgressingEventArgs[] = {
        { "document_page_count", reinterpret_cast<getter>(PrintTaskProgressingEventArgs_get_DocumentPageCount), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_PrintTaskProgressingEventArgs[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintTaskProgressingEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PrintTaskProgressingEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintTaskProgressingEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintTaskProgressingEventArgs) },
        { }};

    static PyType_Spec type_spec_PrintTaskProgressingEventArgs = {
        "winrt._winrt_windows_graphics_printing.PrintTaskProgressingEventArgs",
        sizeof(py::wrapper::Windows::Graphics::Printing::PrintTaskProgressingEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintTaskProgressingEventArgs};

    // ----- PrintTaskRequest class --------------------

    static PyObject* _new_PrintTaskRequest(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Graphics::Printing::PrintTaskRequest>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Graphics::Printing::PrintTaskRequest>::type_name);
        return nullptr;
    }

    static void _dealloc_PrintTaskRequest(py::wrapper::Windows::Graphics::Printing::PrintTaskRequest* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PrintTaskRequest_CreatePrintTask(py::wrapper::Windows::Graphics::Printing::PrintTaskRequest* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 2)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Printing.PrintTaskRequest", L"CreatePrintTask", 2);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(2);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::hstring>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Graphics::Printing::PrintTaskSourceRequestedHandler>(args, 1);

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.CreatePrintTask(param0, param1);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PrintTaskRequest_GetDeferral(py::wrapper::Windows::Graphics::Printing::PrintTaskRequest* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 0)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Printing.PrintTaskRequest", L"GetDeferral", 0);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.GetDeferral();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PrintTaskRequest_get_Deadline(py::wrapper::Windows::Graphics::Printing::PrintTaskRequest* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskRequest", L"Deadline");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Deadline();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_PrintTaskRequest(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Graphics::Printing::PrintTaskRequest>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PrintTaskRequest[] = {
        { "create_print_task", reinterpret_cast<PyCFunction>(PrintTaskRequest_CreatePrintTask), METH_VARARGS, nullptr },
        { "get_deferral", reinterpret_cast<PyCFunction>(PrintTaskRequest_GetDeferral), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_PrintTaskRequest, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PrintTaskRequest), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_PrintTaskRequest[] = {
        { "deadline", reinterpret_cast<getter>(PrintTaskRequest_get_Deadline), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_PrintTaskRequest[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintTaskRequest) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PrintTaskRequest) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintTaskRequest) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintTaskRequest) },
        { }};

    static PyType_Spec type_spec_PrintTaskRequest = {
        "winrt._winrt_windows_graphics_printing.PrintTaskRequest",
        sizeof(py::wrapper::Windows::Graphics::Printing::PrintTaskRequest),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintTaskRequest};

    // ----- PrintTaskRequestedDeferral class --------------------

    static PyObject* _new_PrintTaskRequestedDeferral(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Graphics::Printing::PrintTaskRequestedDeferral>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Graphics::Printing::PrintTaskRequestedDeferral>::type_name);
        return nullptr;
    }

    static void _dealloc_PrintTaskRequestedDeferral(py::wrapper::Windows::Graphics::Printing::PrintTaskRequestedDeferral* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PrintTaskRequestedDeferral_Complete(py::wrapper::Windows::Graphics::Printing::PrintTaskRequestedDeferral* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 0)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Printing.PrintTaskRequestedDeferral", L"Complete", 0);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                {
                    auto _gil = release_gil();
                    self->obj.Complete();
                }

                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

    static PyObject* _from_PrintTaskRequestedDeferral(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Graphics::Printing::PrintTaskRequestedDeferral>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PrintTaskRequestedDeferral[] = {
        { "complete", reinterpret_cast<PyCFunction>(PrintTaskRequestedDeferral_Complete), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_PrintTaskRequestedDeferral, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PrintTaskRequestedDeferral), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_PrintTaskRequestedDeferral[] = {
        { }};

    static PyType_Slot _type_slots_PrintTaskRequestedDeferral[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintTaskRequestedDeferral) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PrintTaskRequestedDeferral) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintTaskRequestedDeferral) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintTaskRequestedDeferral) },
        { }};

    static PyType_Spec type_spec_PrintTaskRequestedDeferral = {
        "winrt._winrt_windows_graphics_printing.PrintTaskRequestedDeferral",
        sizeof(py::wrapper::Windows::Graphics::Printing::PrintTaskRequestedDeferral),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintTaskRequestedDeferral};

    // ----- PrintTaskRequestedEventArgs class --------------------

    static PyObject* _new_PrintTaskRequestedEventArgs(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Graphics::Printing::PrintTaskRequestedEventArgs>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Graphics::Printing::PrintTaskRequestedEventArgs>::type_name);
        return nullptr;
    }

    static void _dealloc_PrintTaskRequestedEventArgs(py::wrapper::Windows::Graphics::Printing::PrintTaskRequestedEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PrintTaskRequestedEventArgs_get_Request(py::wrapper::Windows::Graphics::Printing::PrintTaskRequestedEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskRequestedEventArgs", L"Request");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Request();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_PrintTaskRequestedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Graphics::Printing::PrintTaskRequestedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PrintTaskRequestedEventArgs[] = {
        { "_assign_array_", _assign_array_PrintTaskRequestedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PrintTaskRequestedEventArgs), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_PrintTaskRequestedEventArgs[] = {
        { "request", reinterpret_cast<getter>(PrintTaskRequestedEventArgs_get_Request), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_PrintTaskRequestedEventArgs[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintTaskRequestedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PrintTaskRequestedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintTaskRequestedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintTaskRequestedEventArgs) },
        { }};

    static PyType_Spec type_spec_PrintTaskRequestedEventArgs = {
        "winrt._winrt_windows_graphics_printing.PrintTaskRequestedEventArgs",
        sizeof(py::wrapper::Windows::Graphics::Printing::PrintTaskRequestedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintTaskRequestedEventArgs};

    // ----- PrintTaskSourceRequestedArgs class --------------------

    static PyObject* _new_PrintTaskSourceRequestedArgs(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Graphics::Printing::PrintTaskSourceRequestedArgs>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Graphics::Printing::PrintTaskSourceRequestedArgs>::type_name);
        return nullptr;
    }

    static void _dealloc_PrintTaskSourceRequestedArgs(py::wrapper::Windows::Graphics::Printing::PrintTaskSourceRequestedArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PrintTaskSourceRequestedArgs_GetDeferral(py::wrapper::Windows::Graphics::Printing::PrintTaskSourceRequestedArgs* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 0)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Printing.PrintTaskSourceRequestedArgs", L"GetDeferral", 0);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.GetDeferral();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PrintTaskSourceRequestedArgs_SetSource(py::wrapper::Windows::Graphics::Printing::PrintTaskSourceRequestedArgs* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 1)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Printing.PrintTaskSourceRequestedArgs", L"SetSource", 1);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::IPrintDocumentSource>(args, 0);

                {
                    auto _gil = release_gil();
                    self->obj.SetSource(param0);
                }

                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PrintTaskSourceRequestedArgs_get_Deadline(py::wrapper::Windows::Graphics::Printing::PrintTaskSourceRequestedArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.PrintTaskSourceRequestedArgs", L"Deadline");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Deadline();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_PrintTaskSourceRequestedArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Graphics::Printing::PrintTaskSourceRequestedArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PrintTaskSourceRequestedArgs[] = {
        { "get_deferral", reinterpret_cast<PyCFunction>(PrintTaskSourceRequestedArgs_GetDeferral), METH_VARARGS, nullptr },
        { "set_source", reinterpret_cast<PyCFunction>(PrintTaskSourceRequestedArgs_SetSource), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_PrintTaskSourceRequestedArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PrintTaskSourceRequestedArgs), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_PrintTaskSourceRequestedArgs[] = {
        { "deadline", reinterpret_cast<getter>(PrintTaskSourceRequestedArgs_get_Deadline), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_PrintTaskSourceRequestedArgs[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintTaskSourceRequestedArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PrintTaskSourceRequestedArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintTaskSourceRequestedArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintTaskSourceRequestedArgs) },
        { }};

    static PyType_Spec type_spec_PrintTaskSourceRequestedArgs = {
        "winrt._winrt_windows_graphics_printing.PrintTaskSourceRequestedArgs",
        sizeof(py::wrapper::Windows::Graphics::Printing::PrintTaskSourceRequestedArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintTaskSourceRequestedArgs};

    // ----- PrintTaskSourceRequestedDeferral class --------------------

    static PyObject* _new_PrintTaskSourceRequestedDeferral(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Graphics::Printing::PrintTaskSourceRequestedDeferral>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Graphics::Printing::PrintTaskSourceRequestedDeferral>::type_name);
        return nullptr;
    }

    static void _dealloc_PrintTaskSourceRequestedDeferral(py::wrapper::Windows::Graphics::Printing::PrintTaskSourceRequestedDeferral* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PrintTaskSourceRequestedDeferral_Complete(py::wrapper::Windows::Graphics::Printing::PrintTaskSourceRequestedDeferral* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 0)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Printing.PrintTaskSourceRequestedDeferral", L"Complete", 0);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                {
                    auto _gil = release_gil();
                    self->obj.Complete();
                }

                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

    static PyObject* _from_PrintTaskSourceRequestedDeferral(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Graphics::Printing::PrintTaskSourceRequestedDeferral>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PrintTaskSourceRequestedDeferral[] = {
        { "complete", reinterpret_cast<PyCFunction>(PrintTaskSourceRequestedDeferral_Complete), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_PrintTaskSourceRequestedDeferral, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PrintTaskSourceRequestedDeferral), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_PrintTaskSourceRequestedDeferral[] = {
        { }};

    static PyType_Slot _type_slots_PrintTaskSourceRequestedDeferral[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintTaskSourceRequestedDeferral) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PrintTaskSourceRequestedDeferral) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintTaskSourceRequestedDeferral) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintTaskSourceRequestedDeferral) },
        { }};

    static PyType_Spec type_spec_PrintTaskSourceRequestedDeferral = {
        "winrt._winrt_windows_graphics_printing.PrintTaskSourceRequestedDeferral",
        sizeof(py::wrapper::Windows::Graphics::Printing::PrintTaskSourceRequestedDeferral),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintTaskSourceRequestedDeferral};

    // ----- StandardPrintTaskOptions class --------------------

    static PyObject* _new_StandardPrintTaskOptions(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Graphics::Printing::StandardPrintTaskOptions>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Graphics::Printing::StandardPrintTaskOptions>::type_name);
        return nullptr;
    }

    static PyObject* StandardPrintTaskOptions_get_Copies(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.StandardPrintTaskOptions", L"Copies");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return winrt::Windows::Graphics::Printing::StandardPrintTaskOptions::Copies();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* StandardPrintTaskOptions_get_Binding(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.StandardPrintTaskOptions", L"Binding");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return winrt::Windows::Graphics::Printing::StandardPrintTaskOptions::Binding();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* StandardPrintTaskOptions_get_Collation(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.StandardPrintTaskOptions", L"Collation");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return winrt::Windows::Graphics::Printing::StandardPrintTaskOptions::Collation();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* StandardPrintTaskOptions_get_ColorMode(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.StandardPrintTaskOptions", L"ColorMode");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return winrt::Windows::Graphics::Printing::StandardPrintTaskOptions::ColorMode();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* StandardPrintTaskOptions_get_MediaType(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.StandardPrintTaskOptions", L"MediaType");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return winrt::Windows::Graphics::Printing::StandardPrintTaskOptions::MediaType();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* StandardPrintTaskOptions_get_Duplex(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.StandardPrintTaskOptions", L"Duplex");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return winrt::Windows::Graphics::Printing::StandardPrintTaskOptions::Duplex();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* StandardPrintTaskOptions_get_HolePunch(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.StandardPrintTaskOptions", L"HolePunch");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return winrt::Windows::Graphics::Printing::StandardPrintTaskOptions::HolePunch();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* StandardPrintTaskOptions_get_InputBin(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.StandardPrintTaskOptions", L"InputBin");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return winrt::Windows::Graphics::Printing::StandardPrintTaskOptions::InputBin();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* StandardPrintTaskOptions_get_MediaSize(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.StandardPrintTaskOptions", L"MediaSize");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return winrt::Windows::Graphics::Printing::StandardPrintTaskOptions::MediaSize();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* StandardPrintTaskOptions_get_NUp(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.StandardPrintTaskOptions", L"NUp");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return winrt::Windows::Graphics::Printing::StandardPrintTaskOptions::NUp();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* StandardPrintTaskOptions_get_Orientation(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.StandardPrintTaskOptions", L"Orientation");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return winrt::Windows::Graphics::Printing::StandardPrintTaskOptions::Orientation();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* StandardPrintTaskOptions_get_PrintQuality(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.StandardPrintTaskOptions", L"PrintQuality");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return winrt::Windows::Graphics::Printing::StandardPrintTaskOptions::PrintQuality();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* StandardPrintTaskOptions_get_Staple(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.StandardPrintTaskOptions", L"Staple");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return winrt::Windows::Graphics::Printing::StandardPrintTaskOptions::Staple();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* StandardPrintTaskOptions_get_Bordering(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.StandardPrintTaskOptions", L"Bordering");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return winrt::Windows::Graphics::Printing::StandardPrintTaskOptions::Bordering();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* StandardPrintTaskOptions_get_CustomPageRanges(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.StandardPrintTaskOptions", L"CustomPageRanges");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return winrt::Windows::Graphics::Printing::StandardPrintTaskOptions::CustomPageRanges();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_StandardPrintTaskOptions[] = {
        { }};

    static PyGetSetDef _getset_StandardPrintTaskOptions[] = {
        { }};

    static PyType_Slot _type_slots_StandardPrintTaskOptions[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_StandardPrintTaskOptions) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_StandardPrintTaskOptions) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_StandardPrintTaskOptions) },
        { }};

    static PyType_Spec type_spec_StandardPrintTaskOptions = {
        "winrt._winrt_windows_graphics_printing.StandardPrintTaskOptions",
        0,
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_StandardPrintTaskOptions};

    static PyGetSetDef getset_StandardPrintTaskOptions_Static[] = {
        { "copies", reinterpret_cast<getter>(StandardPrintTaskOptions_get_Copies), nullptr, nullptr, nullptr },
        { "binding", reinterpret_cast<getter>(StandardPrintTaskOptions_get_Binding), nullptr, nullptr, nullptr },
        { "collation", reinterpret_cast<getter>(StandardPrintTaskOptions_get_Collation), nullptr, nullptr, nullptr },
        { "color_mode", reinterpret_cast<getter>(StandardPrintTaskOptions_get_ColorMode), nullptr, nullptr, nullptr },
        { "media_type", reinterpret_cast<getter>(StandardPrintTaskOptions_get_MediaType), nullptr, nullptr, nullptr },
        { "duplex", reinterpret_cast<getter>(StandardPrintTaskOptions_get_Duplex), nullptr, nullptr, nullptr },
        { "hole_punch", reinterpret_cast<getter>(StandardPrintTaskOptions_get_HolePunch), nullptr, nullptr, nullptr },
        { "input_bin", reinterpret_cast<getter>(StandardPrintTaskOptions_get_InputBin), nullptr, nullptr, nullptr },
        { "media_size", reinterpret_cast<getter>(StandardPrintTaskOptions_get_MediaSize), nullptr, nullptr, nullptr },
        { "n_up", reinterpret_cast<getter>(StandardPrintTaskOptions_get_NUp), nullptr, nullptr, nullptr },
        { "orientation", reinterpret_cast<getter>(StandardPrintTaskOptions_get_Orientation), nullptr, nullptr, nullptr },
        { "print_quality", reinterpret_cast<getter>(StandardPrintTaskOptions_get_PrintQuality), nullptr, nullptr, nullptr },
        { "staple", reinterpret_cast<getter>(StandardPrintTaskOptions_get_Staple), nullptr, nullptr, nullptr },
        { "bordering", reinterpret_cast<getter>(StandardPrintTaskOptions_get_Bordering), nullptr, nullptr, nullptr },
        { "custom_page_ranges", reinterpret_cast<getter>(StandardPrintTaskOptions_get_CustomPageRanges), nullptr, nullptr, nullptr },
        { }};

    static PyMethodDef methods_StandardPrintTaskOptions_Static[] = {
        { }};

    static PyType_Slot type_slots_StandardPrintTaskOptions_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_StandardPrintTaskOptions_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_StandardPrintTaskOptions_Static) },
        { }
    };

    static PyType_Spec type_spec_StandardPrintTaskOptions_Static = {
        "winrt._winrt_windows_graphics_printing.StandardPrintTaskOptions_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_StandardPrintTaskOptions_Static};

    // ----- IPrintDocumentSource interface --------------------

    #if PY_VERSION_HEX < 0x030A0000
    static PyObject* _new_IPrintDocumentSource(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Graphics::Printing::IPrintDocumentSource>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Graphics::Printing::IPrintDocumentSource>::type_name);
        return nullptr;
    }
    #endif

    static void _dealloc_IPrintDocumentSource(py::wrapper::Windows::Graphics::Printing::IPrintDocumentSource* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyMethodDef _methods_IPrintDocumentSource[] = {
        { }};

    static PyGetSetDef _getset_IPrintDocumentSource[] = {
        { }};

    static PyType_Slot _type_slots_IPrintDocumentSource[] = {
        #if PY_VERSION_HEX < 0x030A0000
        { Py_tp_new, reinterpret_cast<void*>(_new_IPrintDocumentSource) },
        #endif
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IPrintDocumentSource) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IPrintDocumentSource) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IPrintDocumentSource) },
        { }};

    static PyType_Spec type_spec_IPrintDocumentSource = {
        "winrt._winrt_windows_graphics_printing._IPrintDocumentSource",
        sizeof(py::wrapper::Windows::Graphics::Printing::IPrintDocumentSource),
        0,
        Py_TPFLAGS_DEFAULT
        #if PY_VERSION_HEX >= 0x030A0000
        | Py_TPFLAGS_DISALLOW_INSTANTIATION
        #endif
        ,
        _type_slots_IPrintDocumentSource};

    struct ImplementsIPrintDocumentSource : py::ImplementsInterfaceT<ImplementsIPrintDocumentSource, winrt::Windows::Graphics::Printing::IPrintDocumentSource>
    {
        ImplementsIPrintDocumentSource() = delete;
        ImplementsIPrintDocumentSource(PyObject* py_obj, winrt::impl::inspectable_abi* runtime_class) : py::ImplementsInterfaceT<ImplementsIPrintDocumentSource, winrt::Windows::Graphics::Printing::IPrintDocumentSource>(py_obj, runtime_class)
        {
        }
    };

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

    static PyObject* _from_IPrintDocumentSource(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Graphics::Printing::IPrintDocumentSource>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _guid_ImplementsIPrintDocumentSource(PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::guid_of<winrt::Windows::Graphics::Printing::IPrintDocumentSource>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _make_ImplementsIPrintDocumentSource(PyObject* /*unused*/, PyObject* args) noexcept
    {
        try
        {
            PyObject* py_obj;
            winrt::impl::inspectable_abi* runtime_class;

            if (!PyArg_ParseTuple(args, "On", &py_obj, &runtime_class))
            {
                return nullptr;
            }

            auto iface{std::make_unique<ImplementsIPrintDocumentSource>(py_obj, runtime_class)};

            return PyLong_FromVoidPtr(iface.release());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef methods_ImplementsIPrintDocumentSource[] = {
        { "_assign_array_", _assign_array_IPrintDocumentSource, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_IPrintDocumentSource), METH_O | METH_STATIC, nullptr },
        { "_guid_", reinterpret_cast<PyCFunction>(_guid_ImplementsIPrintDocumentSource), METH_NOARGS | METH_STATIC, nullptr },
        { "_make_", reinterpret_cast<PyCFunction>(_make_ImplementsIPrintDocumentSource), METH_VARARGS | METH_STATIC, nullptr },
        { }};

    static PyType_Slot type_slots_ImplementsIPrintDocumentSource[] = {
        { Py_tp_methods, reinterpret_cast<void*>(methods_ImplementsIPrintDocumentSource) },
        { }};

    static PyType_Spec type_spec_ImplementsIPrintDocumentSource = {
        "winrt._winrt_windows_graphics_printing.IPrintDocumentSource",
        0,
        0,
        Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE
        #if PY_VERSION_HEX >= 0x030A0000
        | Py_TPFLAGS_DISALLOW_INSTANTIATION
        #endif
        ,
        type_slots_ImplementsIPrintDocumentSource};

    // ----- IPrintTaskOptionsCore interface --------------------

    #if PY_VERSION_HEX < 0x030A0000
    static PyObject* _new_IPrintTaskOptionsCore(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Graphics::Printing::IPrintTaskOptionsCore>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Graphics::Printing::IPrintTaskOptionsCore>::type_name);
        return nullptr;
    }
    #endif

    static void _dealloc_IPrintTaskOptionsCore(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCore* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* IPrintTaskOptionsCore_GetPageDescription(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCore* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 1)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCore", L"GetPageDescription", 1);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<uint32_t>(args, 0);

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.GetPageDescription(param0);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyMethodDef _methods_IPrintTaskOptionsCore[] = {
        { "get_page_description", reinterpret_cast<PyCFunction>(IPrintTaskOptionsCore_GetPageDescription), METH_VARARGS, nullptr },
        { }};

    static PyGetSetDef _getset_IPrintTaskOptionsCore[] = {
        { }};

    static PyType_Slot _type_slots_IPrintTaskOptionsCore[] = {
        #if PY_VERSION_HEX < 0x030A0000
        { Py_tp_new, reinterpret_cast<void*>(_new_IPrintTaskOptionsCore) },
        #endif
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IPrintTaskOptionsCore) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IPrintTaskOptionsCore) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IPrintTaskOptionsCore) },
        { }};

    static PyType_Spec type_spec_IPrintTaskOptionsCore = {
        "winrt._winrt_windows_graphics_printing._IPrintTaskOptionsCore",
        sizeof(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCore),
        0,
        Py_TPFLAGS_DEFAULT
        #if PY_VERSION_HEX >= 0x030A0000
        | Py_TPFLAGS_DISALLOW_INSTANTIATION
        #endif
        ,
        _type_slots_IPrintTaskOptionsCore};

    struct ImplementsIPrintTaskOptionsCore : py::ImplementsInterfaceT<ImplementsIPrintTaskOptionsCore, winrt::Windows::Graphics::Printing::IPrintTaskOptionsCore>
    {
        ImplementsIPrintTaskOptionsCore() = delete;
        ImplementsIPrintTaskOptionsCore(PyObject* py_obj, winrt::impl::inspectable_abi* runtime_class) : py::ImplementsInterfaceT<ImplementsIPrintTaskOptionsCore, winrt::Windows::Graphics::Printing::IPrintTaskOptionsCore>(py_obj, runtime_class)
        {
        }

        auto GetPageDescription(uint32_t param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

                py::pyobj_handle method{PyObject_GetAttrString(self.get(), "get_page_description")};
                if (!method)
                {
                    throw python_exception();
                }

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

                py::pyobj_handle return_value{PyObject_CallOneArg(method.get(), py_param0.get())};
                if (!return_value)
                {
                    throw python_exception();
                }

                return py::convert_to<winrt::Windows::Graphics::Printing::PrintPageDescription>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }
    };

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

    static PyObject* _from_IPrintTaskOptionsCore(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Graphics::Printing::IPrintTaskOptionsCore>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _guid_ImplementsIPrintTaskOptionsCore(PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::guid_of<winrt::Windows::Graphics::Printing::IPrintTaskOptionsCore>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _make_ImplementsIPrintTaskOptionsCore(PyObject* /*unused*/, PyObject* args) noexcept
    {
        try
        {
            PyObject* py_obj;
            winrt::impl::inspectable_abi* runtime_class;

            if (!PyArg_ParseTuple(args, "On", &py_obj, &runtime_class))
            {
                return nullptr;
            }

            auto iface{std::make_unique<ImplementsIPrintTaskOptionsCore>(py_obj, runtime_class)};

            return PyLong_FromVoidPtr(iface.release());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef methods_ImplementsIPrintTaskOptionsCore[] = {
        { "_assign_array_", _assign_array_IPrintTaskOptionsCore, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_IPrintTaskOptionsCore), METH_O | METH_STATIC, nullptr },
        { "_guid_", reinterpret_cast<PyCFunction>(_guid_ImplementsIPrintTaskOptionsCore), METH_NOARGS | METH_STATIC, nullptr },
        { "_make_", reinterpret_cast<PyCFunction>(_make_ImplementsIPrintTaskOptionsCore), METH_VARARGS | METH_STATIC, nullptr },
        { }};

    static PyType_Slot type_slots_ImplementsIPrintTaskOptionsCore[] = {
        { Py_tp_methods, reinterpret_cast<void*>(methods_ImplementsIPrintTaskOptionsCore) },
        { }};

    static PyType_Spec type_spec_ImplementsIPrintTaskOptionsCore = {
        "winrt._winrt_windows_graphics_printing.IPrintTaskOptionsCore",
        0,
        0,
        Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE
        #if PY_VERSION_HEX >= 0x030A0000
        | Py_TPFLAGS_DISALLOW_INSTANTIATION
        #endif
        ,
        type_slots_ImplementsIPrintTaskOptionsCore};

    // ----- IPrintTaskOptionsCoreProperties interface --------------------

    #if PY_VERSION_HEX < 0x030A0000
    static PyObject* _new_IPrintTaskOptionsCoreProperties(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties>::type_name);
        return nullptr;
    }
    #endif

    static void _dealloc_IPrintTaskOptionsCoreProperties(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* IPrintTaskOptionsCoreProperties_get_Binding(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"Binding");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Binding();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int IPrintTaskOptionsCoreProperties_put_Binding(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"Binding");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintBinding>(arg);

            {
                auto _gil = release_gil();
                self->obj.Binding(param0);
            }

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

    static PyObject* IPrintTaskOptionsCoreProperties_get_Collation(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"Collation");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Collation();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int IPrintTaskOptionsCoreProperties_put_Collation(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"Collation");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintCollation>(arg);

            {
                auto _gil = release_gil();
                self->obj.Collation(param0);
            }

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

    static PyObject* IPrintTaskOptionsCoreProperties_get_ColorMode(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"ColorMode");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.ColorMode();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int IPrintTaskOptionsCoreProperties_put_ColorMode(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"ColorMode");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintColorMode>(arg);

            {
                auto _gil = release_gil();
                self->obj.ColorMode(param0);
            }

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

    static PyObject* IPrintTaskOptionsCoreProperties_get_Duplex(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"Duplex");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Duplex();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int IPrintTaskOptionsCoreProperties_put_Duplex(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"Duplex");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintDuplex>(arg);

            {
                auto _gil = release_gil();
                self->obj.Duplex(param0);
            }

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

    static PyObject* IPrintTaskOptionsCoreProperties_get_HolePunch(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"HolePunch");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.HolePunch();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int IPrintTaskOptionsCoreProperties_put_HolePunch(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"HolePunch");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintHolePunch>(arg);

            {
                auto _gil = release_gil();
                self->obj.HolePunch(param0);
            }

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

    static PyObject* IPrintTaskOptionsCoreProperties_get_MaxCopies(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"MaxCopies");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.MaxCopies();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* IPrintTaskOptionsCoreProperties_get_MediaSize(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"MediaSize");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.MediaSize();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int IPrintTaskOptionsCoreProperties_put_MediaSize(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"MediaSize");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintMediaSize>(arg);

            {
                auto _gil = release_gil();
                self->obj.MediaSize(param0);
            }

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

    static PyObject* IPrintTaskOptionsCoreProperties_get_MediaType(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"MediaType");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.MediaType();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int IPrintTaskOptionsCoreProperties_put_MediaType(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"MediaType");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintMediaType>(arg);

            {
                auto _gil = release_gil();
                self->obj.MediaType(param0);
            }

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

    static PyObject* IPrintTaskOptionsCoreProperties_get_MinCopies(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"MinCopies");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.MinCopies();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* IPrintTaskOptionsCoreProperties_get_NumberOfCopies(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"NumberOfCopies");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.NumberOfCopies();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int IPrintTaskOptionsCoreProperties_put_NumberOfCopies(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"NumberOfCopies");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<uint32_t>(arg);

            {
                auto _gil = release_gil();
                self->obj.NumberOfCopies(param0);
            }

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

    static PyObject* IPrintTaskOptionsCoreProperties_get_Orientation(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"Orientation");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Orientation();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int IPrintTaskOptionsCoreProperties_put_Orientation(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"Orientation");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintOrientation>(arg);

            {
                auto _gil = release_gil();
                self->obj.Orientation(param0);
            }

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

    static PyObject* IPrintTaskOptionsCoreProperties_get_PrintQuality(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"PrintQuality");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.PrintQuality();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int IPrintTaskOptionsCoreProperties_put_PrintQuality(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"PrintQuality");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintQuality>(arg);

            {
                auto _gil = release_gil();
                self->obj.PrintQuality(param0);
            }

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

    static PyObject* IPrintTaskOptionsCoreProperties_get_Staple(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"Staple");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Staple();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int IPrintTaskOptionsCoreProperties_put_Staple(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreProperties", L"Staple");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Graphics::Printing::PrintStaple>(arg);

            {
                auto _gil = release_gil();
                self->obj.Staple(param0);
            }

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

    static PyMethodDef _methods_IPrintTaskOptionsCoreProperties[] = {
        { }};

    static PyGetSetDef _getset_IPrintTaskOptionsCoreProperties[] = {
        { "binding", reinterpret_cast<getter>(IPrintTaskOptionsCoreProperties_get_Binding), reinterpret_cast<setter>(IPrintTaskOptionsCoreProperties_put_Binding), nullptr, nullptr },
        { "collation", reinterpret_cast<getter>(IPrintTaskOptionsCoreProperties_get_Collation), reinterpret_cast<setter>(IPrintTaskOptionsCoreProperties_put_Collation), nullptr, nullptr },
        { "color_mode", reinterpret_cast<getter>(IPrintTaskOptionsCoreProperties_get_ColorMode), reinterpret_cast<setter>(IPrintTaskOptionsCoreProperties_put_ColorMode), nullptr, nullptr },
        { "duplex", reinterpret_cast<getter>(IPrintTaskOptionsCoreProperties_get_Duplex), reinterpret_cast<setter>(IPrintTaskOptionsCoreProperties_put_Duplex), nullptr, nullptr },
        { "hole_punch", reinterpret_cast<getter>(IPrintTaskOptionsCoreProperties_get_HolePunch), reinterpret_cast<setter>(IPrintTaskOptionsCoreProperties_put_HolePunch), nullptr, nullptr },
        { "max_copies", reinterpret_cast<getter>(IPrintTaskOptionsCoreProperties_get_MaxCopies), nullptr, nullptr, nullptr },
        { "media_size", reinterpret_cast<getter>(IPrintTaskOptionsCoreProperties_get_MediaSize), reinterpret_cast<setter>(IPrintTaskOptionsCoreProperties_put_MediaSize), nullptr, nullptr },
        { "media_type", reinterpret_cast<getter>(IPrintTaskOptionsCoreProperties_get_MediaType), reinterpret_cast<setter>(IPrintTaskOptionsCoreProperties_put_MediaType), nullptr, nullptr },
        { "min_copies", reinterpret_cast<getter>(IPrintTaskOptionsCoreProperties_get_MinCopies), nullptr, nullptr, nullptr },
        { "number_of_copies", reinterpret_cast<getter>(IPrintTaskOptionsCoreProperties_get_NumberOfCopies), reinterpret_cast<setter>(IPrintTaskOptionsCoreProperties_put_NumberOfCopies), nullptr, nullptr },
        { "orientation", reinterpret_cast<getter>(IPrintTaskOptionsCoreProperties_get_Orientation), reinterpret_cast<setter>(IPrintTaskOptionsCoreProperties_put_Orientation), nullptr, nullptr },
        { "print_quality", reinterpret_cast<getter>(IPrintTaskOptionsCoreProperties_get_PrintQuality), reinterpret_cast<setter>(IPrintTaskOptionsCoreProperties_put_PrintQuality), nullptr, nullptr },
        { "staple", reinterpret_cast<getter>(IPrintTaskOptionsCoreProperties_get_Staple), reinterpret_cast<setter>(IPrintTaskOptionsCoreProperties_put_Staple), nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_IPrintTaskOptionsCoreProperties[] = {
        #if PY_VERSION_HEX < 0x030A0000
        { Py_tp_new, reinterpret_cast<void*>(_new_IPrintTaskOptionsCoreProperties) },
        #endif
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IPrintTaskOptionsCoreProperties) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IPrintTaskOptionsCoreProperties) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IPrintTaskOptionsCoreProperties) },
        { }};

    static PyType_Spec type_spec_IPrintTaskOptionsCoreProperties = {
        "winrt._winrt_windows_graphics_printing._IPrintTaskOptionsCoreProperties",
        sizeof(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties),
        0,
        Py_TPFLAGS_DEFAULT
        #if PY_VERSION_HEX >= 0x030A0000
        | Py_TPFLAGS_DISALLOW_INSTANTIATION
        #endif
        ,
        _type_slots_IPrintTaskOptionsCoreProperties};

    struct ImplementsIPrintTaskOptionsCoreProperties : py::ImplementsInterfaceT<ImplementsIPrintTaskOptionsCoreProperties, winrt::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties>
    {
        ImplementsIPrintTaskOptionsCoreProperties() = delete;
        ImplementsIPrintTaskOptionsCoreProperties(PyObject* py_obj, winrt::impl::inspectable_abi* runtime_class) : py::ImplementsInterfaceT<ImplementsIPrintTaskOptionsCoreProperties, winrt::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties>(py_obj, runtime_class)
        {
        }

        auto Binding()
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

                py::pyobj_handle value{PyObject_GetAttrString(self.get(), "binding")};
                if (!value)
                {
                    throw python_exception();
                }

                return py::convert_to<winrt::Windows::Graphics::Printing::PrintBinding>(value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        void Binding(winrt::Windows::Graphics::Printing::PrintBinding param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

                if (PyObject_SetAttrString(self.get(), "binding", value.get()) == -1)
                {
                    throw python_exception();
                }
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto Collation()
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

                py::pyobj_handle value{PyObject_GetAttrString(self.get(), "collation")};
                if (!value)
                {
                    throw python_exception();
                }

                return py::convert_to<winrt::Windows::Graphics::Printing::PrintCollation>(value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        void Collation(winrt::Windows::Graphics::Printing::PrintCollation param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

                if (PyObject_SetAttrString(self.get(), "collation", value.get()) == -1)
                {
                    throw python_exception();
                }
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto ColorMode()
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

                py::pyobj_handle value{PyObject_GetAttrString(self.get(), "color_mode")};
                if (!value)
                {
                    throw python_exception();
                }

                return py::convert_to<winrt::Windows::Graphics::Printing::PrintColorMode>(value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        void ColorMode(winrt::Windows::Graphics::Printing::PrintColorMode param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

                if (PyObject_SetAttrString(self.get(), "color_mode", value.get()) == -1)
                {
                    throw python_exception();
                }
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto Duplex()
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

                py::pyobj_handle value{PyObject_GetAttrString(self.get(), "duplex")};
                if (!value)
                {
                    throw python_exception();
                }

                return py::convert_to<winrt::Windows::Graphics::Printing::PrintDuplex>(value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        void Duplex(winrt::Windows::Graphics::Printing::PrintDuplex param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

                if (PyObject_SetAttrString(self.get(), "duplex", value.get()) == -1)
                {
                    throw python_exception();
                }
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto HolePunch()
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

                py::pyobj_handle value{PyObject_GetAttrString(self.get(), "hole_punch")};
                if (!value)
                {
                    throw python_exception();
                }

                return py::convert_to<winrt::Windows::Graphics::Printing::PrintHolePunch>(value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        void HolePunch(winrt::Windows::Graphics::Printing::PrintHolePunch param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

                if (PyObject_SetAttrString(self.get(), "hole_punch", value.get()) == -1)
                {
                    throw python_exception();
                }
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto MaxCopies()
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

                py::pyobj_handle value{PyObject_GetAttrString(self.get(), "max_copies")};
                if (!value)
                {
                    throw python_exception();
                }

                return py::convert_to<uint32_t>(value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto MediaSize()
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

                py::pyobj_handle value{PyObject_GetAttrString(self.get(), "media_size")};
                if (!value)
                {
                    throw python_exception();
                }

                return py::convert_to<winrt::Windows::Graphics::Printing::PrintMediaSize>(value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        void MediaSize(winrt::Windows::Graphics::Printing::PrintMediaSize param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

                if (PyObject_SetAttrString(self.get(), "media_size", value.get()) == -1)
                {
                    throw python_exception();
                }
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto MediaType()
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

                py::pyobj_handle value{PyObject_GetAttrString(self.get(), "media_type")};
                if (!value)
                {
                    throw python_exception();
                }

                return py::convert_to<winrt::Windows::Graphics::Printing::PrintMediaType>(value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        void MediaType(winrt::Windows::Graphics::Printing::PrintMediaType param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

                if (PyObject_SetAttrString(self.get(), "media_type", value.get()) == -1)
                {
                    throw python_exception();
                }
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto MinCopies()
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

                py::pyobj_handle value{PyObject_GetAttrString(self.get(), "min_copies")};
                if (!value)
                {
                    throw python_exception();
                }

                return py::convert_to<uint32_t>(value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto NumberOfCopies()
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

                py::pyobj_handle value{PyObject_GetAttrString(self.get(), "number_of_copies")};
                if (!value)
                {
                    throw python_exception();
                }

                return py::convert_to<uint32_t>(value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        void NumberOfCopies(uint32_t param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

                if (PyObject_SetAttrString(self.get(), "number_of_copies", value.get()) == -1)
                {
                    throw python_exception();
                }
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto Orientation()
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

                py::pyobj_handle value{PyObject_GetAttrString(self.get(), "orientation")};
                if (!value)
                {
                    throw python_exception();
                }

                return py::convert_to<winrt::Windows::Graphics::Printing::PrintOrientation>(value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        void Orientation(winrt::Windows::Graphics::Printing::PrintOrientation param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

                if (PyObject_SetAttrString(self.get(), "orientation", value.get()) == -1)
                {
                    throw python_exception();
                }
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto PrintQuality()
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

                py::pyobj_handle value{PyObject_GetAttrString(self.get(), "print_quality")};
                if (!value)
                {
                    throw python_exception();
                }

                return py::convert_to<winrt::Windows::Graphics::Printing::PrintQuality>(value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        void PrintQuality(winrt::Windows::Graphics::Printing::PrintQuality param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

                if (PyObject_SetAttrString(self.get(), "print_quality", value.get()) == -1)
                {
                    throw python_exception();
                }
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto Staple()
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

                py::pyobj_handle value{PyObject_GetAttrString(self.get(), "staple")};
                if (!value)
                {
                    throw python_exception();
                }

                return py::convert_to<winrt::Windows::Graphics::Printing::PrintStaple>(value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        void Staple(winrt::Windows::Graphics::Printing::PrintStaple param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

                if (PyObject_SetAttrString(self.get(), "staple", value.get()) == -1)
                {
                    throw python_exception();
                }
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }
    };

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

    static PyObject* _from_IPrintTaskOptionsCoreProperties(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _guid_ImplementsIPrintTaskOptionsCoreProperties(PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::guid_of<winrt::Windows::Graphics::Printing::IPrintTaskOptionsCoreProperties>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _make_ImplementsIPrintTaskOptionsCoreProperties(PyObject* /*unused*/, PyObject* args) noexcept
    {
        try
        {
            PyObject* py_obj;
            winrt::impl::inspectable_abi* runtime_class;

            if (!PyArg_ParseTuple(args, "On", &py_obj, &runtime_class))
            {
                return nullptr;
            }

            auto iface{std::make_unique<ImplementsIPrintTaskOptionsCoreProperties>(py_obj, runtime_class)};

            return PyLong_FromVoidPtr(iface.release());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef methods_ImplementsIPrintTaskOptionsCoreProperties[] = {
        { "_assign_array_", _assign_array_IPrintTaskOptionsCoreProperties, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_IPrintTaskOptionsCoreProperties), METH_O | METH_STATIC, nullptr },
        { "_guid_", reinterpret_cast<PyCFunction>(_guid_ImplementsIPrintTaskOptionsCoreProperties), METH_NOARGS | METH_STATIC, nullptr },
        { "_make_", reinterpret_cast<PyCFunction>(_make_ImplementsIPrintTaskOptionsCoreProperties), METH_VARARGS | METH_STATIC, nullptr },
        { }};

    static PyType_Slot type_slots_ImplementsIPrintTaskOptionsCoreProperties[] = {
        { Py_tp_methods, reinterpret_cast<void*>(methods_ImplementsIPrintTaskOptionsCoreProperties) },
        { }};

    static PyType_Spec type_spec_ImplementsIPrintTaskOptionsCoreProperties = {
        "winrt._winrt_windows_graphics_printing.IPrintTaskOptionsCoreProperties",
        0,
        0,
        Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE
        #if PY_VERSION_HEX >= 0x030A0000
        | Py_TPFLAGS_DISALLOW_INSTANTIATION
        #endif
        ,
        type_slots_ImplementsIPrintTaskOptionsCoreProperties};

    // ----- IPrintTaskOptionsCoreUIConfiguration interface --------------------

    #if PY_VERSION_HEX < 0x030A0000
    static PyObject* _new_IPrintTaskOptionsCoreUIConfiguration(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Graphics::Printing::IPrintTaskOptionsCoreUIConfiguration>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Graphics::Printing::IPrintTaskOptionsCoreUIConfiguration>::type_name);
        return nullptr;
    }
    #endif

    static void _dealloc_IPrintTaskOptionsCoreUIConfiguration(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreUIConfiguration* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* IPrintTaskOptionsCoreUIConfiguration_get_DisplayedOptions(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreUIConfiguration* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Printing.IPrintTaskOptionsCoreUIConfiguration", L"DisplayedOptions");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.DisplayedOptions();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_IPrintTaskOptionsCoreUIConfiguration[] = {
        { }};

    static PyGetSetDef _getset_IPrintTaskOptionsCoreUIConfiguration[] = {
        { "displayed_options", reinterpret_cast<getter>(IPrintTaskOptionsCoreUIConfiguration_get_DisplayedOptions), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_IPrintTaskOptionsCoreUIConfiguration[] = {
        #if PY_VERSION_HEX < 0x030A0000
        { Py_tp_new, reinterpret_cast<void*>(_new_IPrintTaskOptionsCoreUIConfiguration) },
        #endif
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IPrintTaskOptionsCoreUIConfiguration) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IPrintTaskOptionsCoreUIConfiguration) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IPrintTaskOptionsCoreUIConfiguration) },
        { }};

    static PyType_Spec type_spec_IPrintTaskOptionsCoreUIConfiguration = {
        "winrt._winrt_windows_graphics_printing._IPrintTaskOptionsCoreUIConfiguration",
        sizeof(py::wrapper::Windows::Graphics::Printing::IPrintTaskOptionsCoreUIConfiguration),
        0,
        Py_TPFLAGS_DEFAULT
        #if PY_VERSION_HEX >= 0x030A0000
        | Py_TPFLAGS_DISALLOW_INSTANTIATION
        #endif
        ,
        _type_slots_IPrintTaskOptionsCoreUIConfiguration};

    struct ImplementsIPrintTaskOptionsCoreUIConfiguration : py::ImplementsInterfaceT<ImplementsIPrintTaskOptionsCoreUIConfiguration, winrt::Windows::Graphics::Printing::IPrintTaskOptionsCoreUIConfiguration>
    {
        ImplementsIPrintTaskOptionsCoreUIConfiguration() = delete;
        ImplementsIPrintTaskOptionsCoreUIConfiguration(PyObject* py_obj, winrt::impl::inspectable_abi* runtime_class) : py::ImplementsInterfaceT<ImplementsIPrintTaskOptionsCoreUIConfiguration, winrt::Windows::Graphics::Printing::IPrintTaskOptionsCoreUIConfiguration>(py_obj, runtime_class)
        {
        }

        auto DisplayedOptions()
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

                py::pyobj_handle value{PyObject_GetAttrString(self.get(), "displayed_options")};
                if (!value)
                {
                    throw python_exception();
                }

                return py::convert_to<winrt::Windows::Foundation::Collections::IVector<winrt::hstring>>(value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }
    };

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

    static PyObject* _from_IPrintTaskOptionsCoreUIConfiguration(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::Graphics::Printing::IPrintTaskOptionsCoreUIConfiguration>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _guid_ImplementsIPrintTaskOptionsCoreUIConfiguration(PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::guid_of<winrt::Windows::Graphics::Printing::IPrintTaskOptionsCoreUIConfiguration>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _make_ImplementsIPrintTaskOptionsCoreUIConfiguration(PyObject* /*unused*/, PyObject* args) noexcept
    {
        try
        {
            PyObject* py_obj;
            winrt::impl::inspectable_abi* runtime_class;

            if (!PyArg_ParseTuple(args, "On", &py_obj, &runtime_class))
            {
                return nullptr;
            }

            auto iface{std::make_unique<ImplementsIPrintTaskOptionsCoreUIConfiguration>(py_obj, runtime_class)};

            return PyLong_FromVoidPtr(iface.release());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef methods_ImplementsIPrintTaskOptionsCoreUIConfiguration[] = {
        { "_assign_array_", _assign_array_IPrintTaskOptionsCoreUIConfiguration, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_IPrintTaskOptionsCoreUIConfiguration), METH_O | METH_STATIC, nullptr },
        { "_guid_", reinterpret_cast<PyCFunction>(_guid_ImplementsIPrintTaskOptionsCoreUIConfiguration), METH_NOARGS | METH_STATIC, nullptr },
        { "_make_", reinterpret_cast<PyCFunction>(_make_ImplementsIPrintTaskOptionsCoreUIConfiguration), METH_VARARGS | METH_STATIC, nullptr },
        { }};

    static PyType_Slot type_slots_ImplementsIPrintTaskOptionsCoreUIConfiguration[] = {
        { Py_tp_methods, reinterpret_cast<void*>(methods_ImplementsIPrintTaskOptionsCoreUIConfiguration) },
        { }};

    static PyType_Spec type_spec_ImplementsIPrintTaskOptionsCoreUIConfiguration = {
        "winrt._winrt_windows_graphics_printing.IPrintTaskOptionsCoreUIConfiguration",
        0,
        0,
        Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE
        #if PY_VERSION_HEX >= 0x030A0000
        | Py_TPFLAGS_DISALLOW_INSTANTIATION
        #endif
        ,
        type_slots_ImplementsIPrintTaskOptionsCoreUIConfiguration};

    // ----- PrintPageDescription struct --------------------

    winrt::Windows::Graphics::Printing::PrintPageDescription PrintPageDescription_from_tuple(PyObject* tuple)
    {
        if (PyTuple_GET_SIZE(tuple) != 4)
        {
            PyErr_SetString(PyExc_TypeError, "Incorrect number of fields");
            throw python_exception();
        }

        winrt::Windows::Graphics::Printing::PrintPageDescription result{};

        result.PageSize = py::convert_to<winrt::Windows::Foundation::Size>(tuple, 0);
        result.ImageableRect = py::convert_to<winrt::Windows::Foundation::Rect>(tuple, 1);
        result.DpiX = py::convert_to<uint32_t>(tuple, 2);
        result.DpiY = py::convert_to<uint32_t>(tuple, 3);

        return result;
    }

    PyObject* _new_PrintPageDescription(PyTypeObject* subclass, PyObject* args, PyObject* kwds) noexcept
    {
        pyobj_handle self_obj{(subclass->tp_alloc(subclass, 0))};
        if (!self_obj)
        {
            return nullptr;
        }

        auto self = reinterpret_cast<winrt_struct_wrapper<winrt::Windows::Graphics::Printing::PrintPageDescription>*>(self_obj.get());
        std::construct_at(&self->obj);

        auto tuple_size = PyTuple_GET_SIZE(args);
        if ((tuple_size == 0) && (!kwds))
        {
            return self_obj.detach();
        }

        PyObject* _PageSize{};
        PyObject* _ImageableRect{};
        uint32_t _DpiX{};
        uint32_t _DpiY{};

        static const char* kwlist[] = {"page_size", "imageable_rect", "dpi_x", "dpi_y", nullptr};
        if (!PyArg_ParseTupleAndKeywords(args, kwds, "|OOII", const_cast<char**>(kwlist), &_PageSize, &_ImageableRect, &_DpiX, &_DpiY))
        {
            return nullptr;
        }

        try
        {
            self->obj.PageSize = _PageSize ? py::convert_to<winrt::Windows::Foundation::Size>(_PageSize) : winrt::Windows::Foundation::Size{};
            self->obj.ImageableRect = _ImageableRect ? py::convert_to<winrt::Windows::Foundation::Rect>(_ImageableRect) : winrt::Windows::Foundation::Rect{};
            self->obj.DpiX = _DpiX;
            self->obj.DpiY = _DpiY;

            return self_obj.detach();
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static void _dealloc_PrintPageDescription(py::wrapper::Windows::Graphics::Printing::PrintPageDescription* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

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

    PyObject* _replace_PrintPageDescription(py::wrapper::Windows::Graphics::Printing::PrintPageDescription* self, PyObject* args, PyObject* kwds) noexcept
    {
        try
        {
            PyObject* _PageSize{};
            PyObject* _ImageableRect{};
            uint32_t _DpiX{self->obj.DpiX};
            uint32_t _DpiY{self->obj.DpiY};

            static const char* kwlist[] = {"page_size", "imageable_rect", "dpi_x", "dpi_y", nullptr};
            if (!PyArg_ParseTupleAndKeywords(args, kwds, "|$OOII", const_cast<char**>(kwlist), &_PageSize, &_ImageableRect, &_DpiX, &_DpiY))
            {
                return nullptr;
            }

            auto copy = self->obj;
            copy.PageSize = _PageSize ? py::convert_to<winrt::Windows::Foundation::Size>(_PageSize) : self->obj.PageSize;
            copy.ImageableRect = _ImageableRect ? py::convert_to<winrt::Windows::Foundation::Rect>(_ImageableRect) : self->obj.ImageableRect;
            copy.DpiX = _DpiX;
            copy.DpiY = _DpiY;

            return convert(copy);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    PyObject* unpack_PrintPageDescription(py::wrapper::Windows::Graphics::Printing::PrintPageDescription* self, PyObject* /*unused*/) noexcept
    {
        py::pyobj_handle unpack_str{PyUnicode_InternFromString("unpack")};
        if (!unpack_str)
        {
            return nullptr;
        }

        py::pyobj_handle PageSize{convert(self->obj.PageSize)};
        if (!PageSize)
        {
            return nullptr;
        }

        PageSize.attach(PyObject_CallMethodNoArgs(PageSize.get(), unpack_str.get()));
        if (!PageSize)
        {
            return nullptr;
        }

        py::pyobj_handle ImageableRect{convert(self->obj.ImageableRect)};
        if (!ImageableRect)
        {
            return nullptr;
        }

        ImageableRect.attach(PyObject_CallMethodNoArgs(ImageableRect.get(), unpack_str.get()));
        if (!ImageableRect)
        {
            return nullptr;
        }

        py::pyobj_handle DpiX{convert(self->obj.DpiX)};
        if (!DpiX)
        {
            return nullptr;
        }

        py::pyobj_handle DpiY{convert(self->obj.DpiY)};
        if (!DpiY)
        {
            return nullptr;
        }

        pyobj_handle tuple{PyTuple_New(4)};
        if (!tuple)
        {
            return nullptr;
        }

        PyTuple_SET_ITEM(tuple.get(), 0, PageSize.detach());
        PyTuple_SET_ITEM(tuple.get(), 1, ImageableRect.detach());
        PyTuple_SET_ITEM(tuple.get(), 2, DpiX.detach());
        PyTuple_SET_ITEM(tuple.get(), 3, DpiY.detach());

        return tuple.detach();
    }

    static PyMethodDef _methods_PrintPageDescription[] = {
        { "_assign_array_", _assign_array_PrintPageDescription, METH_O | METH_STATIC, nullptr },
        { "__replace__", reinterpret_cast<PyCFunction>(reinterpret_cast<void*>(_replace_PrintPageDescription)), METH_VARARGS | METH_KEYWORDS, nullptr },
        { "unpack", reinterpret_cast<PyCFunction>(unpack_PrintPageDescription), METH_NOARGS, nullptr },
        { }};

    static PyObject* PrintPageDescription_get_PageSize(py::wrapper::Windows::Graphics::Printing::PrintPageDescription* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.PageSize);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintPageDescription_get_ImageableRect(py::wrapper::Windows::Graphics::Printing::PrintPageDescription* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.ImageableRect);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintPageDescription_get_DpiX(py::wrapper::Windows::Graphics::Printing::PrintPageDescription* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.DpiX);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintPageDescription_get_DpiY(py::wrapper::Windows::Graphics::Printing::PrintPageDescription* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.DpiY);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyGetSetDef _getset_PrintPageDescription[] = {
        { "page_size", reinterpret_cast<getter>(PrintPageDescription_get_PageSize), nullptr, nullptr, nullptr },
        { "imageable_rect", reinterpret_cast<getter>(PrintPageDescription_get_ImageableRect), nullptr, nullptr, nullptr },
        { "dpi_x", reinterpret_cast<getter>(PrintPageDescription_get_DpiX), nullptr, nullptr, nullptr },
        { "dpi_y", reinterpret_cast<getter>(PrintPageDescription_get_DpiY), nullptr, nullptr, nullptr },
        { }};

    static PyObject* _richcompare_PrintPageDescription(py::wrapper::Windows::Graphics::Printing::PrintPageDescription* self, PyObject* other, int op) noexcept
    {
        try
        {
            auto _other = py::convert_to<winrt::Windows::Graphics::Printing::PrintPageDescription>(other);

            if (op == Py_EQ)
            {
                if (self->obj == _other)
                {
                    Py_RETURN_TRUE;
                }

                Py_RETURN_FALSE;
            }

            if (op == Py_NE)
            {
                if (self->obj != _other)
                {
                    Py_RETURN_TRUE;
                }

                Py_RETURN_FALSE;
            }

            Py_RETURN_NOTIMPLEMENTED;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _repr_PrintPageDescription(PyObject* self) noexcept
    {
        py::pyobj_handle PageSize{PyObject_GetAttrString(self, "page_size")};
        if (!PageSize)
        {
            return nullptr;
        }

        py::pyobj_handle ImageableRect{PyObject_GetAttrString(self, "imageable_rect")};
        if (!ImageableRect)
        {
            return nullptr;
        }

        py::pyobj_handle DpiX{PyObject_GetAttrString(self, "dpi_x")};
        if (!DpiX)
        {
            return nullptr;
        }

        py::pyobj_handle DpiY{PyObject_GetAttrString(self, "dpi_y")};
        if (!DpiY)
        {
            return nullptr;
        }

        return PyUnicode_FromFormat("PrintPageDescription(page_size=%R, imageable_rect=%R, dpi_x=%R, dpi_y=%R)", PageSize.get(), ImageableRect.get(), DpiX.get(), DpiY.get());
    }

    static PyType_Slot _type_slots_PrintPageDescription[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintPageDescription) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PrintPageDescription) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintPageDescription) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintPageDescription) },
        { Py_tp_richcompare, reinterpret_cast<void*>(_richcompare_PrintPageDescription) },
        { Py_tp_repr, reinterpret_cast<void*>(_repr_PrintPageDescription) },
        { }};

    static PyType_Spec type_spec_PrintPageDescription = {
        "winrt._winrt_windows_graphics_printing.PrintPageDescription",
        sizeof(py::wrapper::Windows::Graphics::Printing::PrintPageDescription),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintPageDescription};

    // ----- Windows.Graphics.Printing Initialization --------------------

    PyDoc_STRVAR(module_doc, "Windows.Graphics.Printing");

    static PyModuleDef module_def = {
        PyModuleDef_HEAD_INIT,
        "_winrt_windows_graphics_printing",
        module_doc,
        0,
        nullptr,
        nullptr,
        nullptr,
        nullptr,
        nullptr};
} // py::cpp::Windows::Graphics::Printing

PyMODINIT_FUNC PyInit__winrt_windows_graphics_printing(void) noexcept
{
    using namespace py::cpp::Windows::Graphics::Printing;

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

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

    if (!module)
    {
        return nullptr;
    }

    auto inspectable_meta_type = py::get_inspectable_meta_type();
    if (!inspectable_meta_type)
    {
        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 PrintManager_Static_bases{PyTuple_Pack(1, reinterpret_cast<PyObject*>(inspectable_meta_type))};
    if (!PrintManager_Static_bases)
    {
        return nullptr;
    }

    py::pyobj_handle type_PrintManager_Static{PyType_FromSpecWithBases(&type_spec_PrintManager_Static, PrintManager_Static_bases.get())};
    if (!type_PrintManager_Static)
    {
        return nullptr;
    }

    py::pytype_handle PrintManager_type{py::register_python_type(module.get(), &type_spec_PrintManager, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_PrintManager_Static.get()))};
    if (!PrintManager_type)
    {
        return nullptr;
    }

    py::pytype_handle PrintPageInfo_type{py::register_python_type(module.get(), &type_spec_PrintPageInfo, object_bases.get(), inspectable_meta_type)};
    if (!PrintPageInfo_type)
    {
        return nullptr;
    }

    py::pytype_handle PrintPageRange_type{py::register_python_type(module.get(), &type_spec_PrintPageRange, object_bases.get(), inspectable_meta_type)};
    if (!PrintPageRange_type)
    {
        return nullptr;
    }

    py::pytype_handle PrintPageRangeOptions_type{py::register_python_type(module.get(), &type_spec_PrintPageRangeOptions, object_bases.get(), inspectable_meta_type)};
    if (!PrintPageRangeOptions_type)
    {
        return nullptr;
    }

    py::pytype_handle PrintTask_type{py::register_python_type(module.get(), &type_spec_PrintTask, object_bases.get(), inspectable_meta_type)};
    if (!PrintTask_type)
    {
        return nullptr;
    }

    py::pytype_handle PrintTaskCompletedEventArgs_type{py::register_python_type(module.get(), &type_spec_PrintTaskCompletedEventArgs, object_bases.get(), inspectable_meta_type)};
    if (!PrintTaskCompletedEventArgs_type)
    {
        return nullptr;
    }

    py::pytype_handle PrintTaskOptions_type{py::register_python_type(module.get(), &type_spec_PrintTaskOptions, object_bases.get(), inspectable_meta_type)};
    if (!PrintTaskOptions_type)
    {
        return nullptr;
    }

    py::pytype_handle PrintTaskProgressingEventArgs_type{py::register_python_type(module.get(), &type_spec_PrintTaskProgressingEventArgs, object_bases.get(), inspectable_meta_type)};
    if (!PrintTaskProgressingEventArgs_type)
    {
        return nullptr;
    }

    py::pytype_handle PrintTaskRequest_type{py::register_python_type(module.get(), &type_spec_PrintTaskRequest, object_bases.get(), inspectable_meta_type)};
    if (!PrintTaskRequest_type)
    {
        return nullptr;
    }

    py::pytype_handle PrintTaskRequestedDeferral_type{py::register_python_type(module.get(), &type_spec_PrintTaskRequestedDeferral, object_bases.get(), inspectable_meta_type)};
    if (!PrintTaskRequestedDeferral_type)
    {
        return nullptr;
    }

    py::pytype_handle PrintTaskRequestedEventArgs_type{py::register_python_type(module.get(), &type_spec_PrintTaskRequestedEventArgs, object_bases.get(), inspectable_meta_type)};
    if (!PrintTaskRequestedEventArgs_type)
    {
        return nullptr;
    }

    py::pytype_handle PrintTaskSourceRequestedArgs_type{py::register_python_type(module.get(), &type_spec_PrintTaskSourceRequestedArgs, object_bases.get(), inspectable_meta_type)};
    if (!PrintTaskSourceRequestedArgs_type)
    {
        return nullptr;
    }

    py::pytype_handle PrintTaskSourceRequestedDeferral_type{py::register_python_type(module.get(), &type_spec_PrintTaskSourceRequestedDeferral, object_bases.get(), inspectable_meta_type)};
    if (!PrintTaskSourceRequestedDeferral_type)
    {
        return nullptr;
    }

    py::pyobj_handle StandardPrintTaskOptions_Static_bases{PyTuple_Pack(1, reinterpret_cast<PyObject*>(inspectable_meta_type))};
    if (!StandardPrintTaskOptions_Static_bases)
    {
        return nullptr;
    }

    py::pyobj_handle type_StandardPrintTaskOptions_Static{PyType_FromSpecWithBases(&type_spec_StandardPrintTaskOptions_Static, StandardPrintTaskOptions_Static_bases.get())};
    if (!type_StandardPrintTaskOptions_Static)
    {
        return nullptr;
    }

    py::pytype_handle StandardPrintTaskOptions_type{py::register_python_type(module.get(), &type_spec_StandardPrintTaskOptions, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_StandardPrintTaskOptions_Static.get()))};
    if (!StandardPrintTaskOptions_type)
    {
        return nullptr;
    }

    py::pytype_handle IPrintDocumentSource_type{py::register_python_type(module.get(), &type_spec_IPrintDocumentSource, object_bases.get(), nullptr)};
    if (!IPrintDocumentSource_type)
    {
        return nullptr;
    }

    py::pytype_handle ImplementsIPrintDocumentSource_type{py::register_python_type(module.get(), &type_spec_ImplementsIPrintDocumentSource, nullptr, inspectable_meta_type)};
    if (!ImplementsIPrintDocumentSource_type)
    {
        return nullptr;
    }

    if (PyModule_AddType(module.get(), ImplementsIPrintDocumentSource_type.get()) == -1)
    {
        return nullptr;
    }

    py::pytype_handle IPrintTaskOptionsCore_type{py::register_python_type(module.get(), &type_spec_IPrintTaskOptionsCore, object_bases.get(), nullptr)};
    if (!IPrintTaskOptionsCore_type)
    {
        return nullptr;
    }

    py::pytype_handle ImplementsIPrintTaskOptionsCore_type{py::register_python_type(module.get(), &type_spec_ImplementsIPrintTaskOptionsCore, nullptr, inspectable_meta_type)};
    if (!ImplementsIPrintTaskOptionsCore_type)
    {
        return nullptr;
    }

    if (PyModule_AddType(module.get(), ImplementsIPrintTaskOptionsCore_type.get()) == -1)
    {
        return nullptr;
    }

    py::pytype_handle IPrintTaskOptionsCoreProperties_type{py::register_python_type(module.get(), &type_spec_IPrintTaskOptionsCoreProperties, object_bases.get(), nullptr)};
    if (!IPrintTaskOptionsCoreProperties_type)
    {
        return nullptr;
    }

    py::pytype_handle ImplementsIPrintTaskOptionsCoreProperties_type{py::register_python_type(module.get(), &type_spec_ImplementsIPrintTaskOptionsCoreProperties, nullptr, inspectable_meta_type)};
    if (!ImplementsIPrintTaskOptionsCoreProperties_type)
    {
        return nullptr;
    }

    if (PyModule_AddType(module.get(), ImplementsIPrintTaskOptionsCoreProperties_type.get()) == -1)
    {
        return nullptr;
    }

    py::pytype_handle IPrintTaskOptionsCoreUIConfiguration_type{py::register_python_type(module.get(), &type_spec_IPrintTaskOptionsCoreUIConfiguration, object_bases.get(), nullptr)};
    if (!IPrintTaskOptionsCoreUIConfiguration_type)
    {
        return nullptr;
    }

    py::pytype_handle ImplementsIPrintTaskOptionsCoreUIConfiguration_type{py::register_python_type(module.get(), &type_spec_ImplementsIPrintTaskOptionsCoreUIConfiguration, nullptr, inspectable_meta_type)};
    if (!ImplementsIPrintTaskOptionsCoreUIConfiguration_type)
    {
        return nullptr;
    }

    if (PyModule_AddType(module.get(), ImplementsIPrintTaskOptionsCoreUIConfiguration_type.get()) == -1)
    {
        return nullptr;
    }

    py::pytype_handle PrintPageDescription_type{py::register_python_type(module.get(), &type_spec_PrintPageDescription, nullptr, nullptr)};
    if (!PrintPageDescription_type)
    {
        return nullptr;
    }

    py::pyobj_handle PrintPageDescription_from_tuple_capsule{PyCapsule_New(reinterpret_cast<void*>(PrintPageDescription_from_tuple),"winrt._winrt_windows_graphics_printing.PrintPageDescription_from_tuple", nullptr)};
    if (!PrintPageDescription_from_tuple_capsule)
    {
        return nullptr;
    }

    if (PyModule_AddObjectRef(module.get(), "PrintPageDescription_from_tuple", PrintPageDescription_from_tuple_capsule.get()) == -1)
    {
        return nullptr;
    }

    return module.detach();
}
