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

#include "py.Windows.Devices.Printers.Extensions.h"

namespace py::cpp::Windows::Devices::Printers::Extensions
{
    // ----- Print3DWorkflow class --------------------

    static PyObject* _new_Print3DWorkflow(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Devices::Printers::Extensions::Print3DWorkflow>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::Printers::Extensions::Print3DWorkflow>::type_name);
        return nullptr;
    }

    static void _dealloc_Print3DWorkflow(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflow* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* Print3DWorkflow_GetPrintModelPackage(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflow* 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.Devices.Printers.Extensions.Print3DWorkflow", L"GetPrintModelPackage", 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.GetPrintModelPackage();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* Print3DWorkflow_get_IsPrintReady(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflow* 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.Devices.Printers.Extensions.Print3DWorkflow", L"IsPrintReady");
            }

            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.IsPrintReady();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int Print3DWorkflow_put_IsPrintReady(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflow* 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.Devices.Printers.Extensions.Print3DWorkflow", L"IsPrintReady");
            }

            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.IsPrintReady(param0);
            }

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

    static PyObject* Print3DWorkflow_get_DeviceID(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflow* 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.Devices.Printers.Extensions.Print3DWorkflow", L"DeviceID");
            }

            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.DeviceID();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* Print3DWorkflow_add_PrintRequested(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflow* 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.Devices.Printers.Extensions.Print3DWorkflow", L"PrintRequested");
            }

            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::Devices::Printers::Extensions::Print3DWorkflow, winrt::Windows::Devices::Printers::Extensions::Print3DWorkflowPrintRequestedEventArgs>>(arg);

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

    static PyObject* Print3DWorkflow_remove_PrintRequested(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflow* 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.Devices.Printers.Extensions.Print3DWorkflow", L"PrintRequested");
            }

            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.PrintRequested(param0);
            }

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

    static PyObject* Print3DWorkflow_add_PrinterChanged(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflow* 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.Devices.Printers.Extensions.Print3DWorkflow", L"PrinterChanged");
            }

            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::Devices::Printers::Extensions::Print3DWorkflow, winrt::Windows::Devices::Printers::Extensions::Print3DWorkflowPrinterChangedEventArgs>>(arg);

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

    static PyObject* Print3DWorkflow_remove_PrinterChanged(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflow* 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.Devices.Printers.Extensions.Print3DWorkflow", L"PrinterChanged");
            }

            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.PrinterChanged(param0);
            }

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

    static PyObject* _assign_array_Print3DWorkflow(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Devices::Printers::Extensions::Print3DWorkflow>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_Print3DWorkflow(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::Devices::Printers::Extensions::Print3DWorkflow>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_Print3DWorkflow[] = {
        { "get_print_model_package", reinterpret_cast<PyCFunction>(Print3DWorkflow_GetPrintModelPackage), METH_VARARGS, nullptr },
        { "add_print_requested", reinterpret_cast<PyCFunction>(Print3DWorkflow_add_PrintRequested), METH_O, nullptr },
        { "remove_print_requested", reinterpret_cast<PyCFunction>(Print3DWorkflow_remove_PrintRequested), METH_O, nullptr },
        { "add_printer_changed", reinterpret_cast<PyCFunction>(Print3DWorkflow_add_PrinterChanged), METH_O, nullptr },
        { "remove_printer_changed", reinterpret_cast<PyCFunction>(Print3DWorkflow_remove_PrinterChanged), METH_O, nullptr },
        { "_assign_array_", _assign_array_Print3DWorkflow, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_Print3DWorkflow), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_Print3DWorkflow[] = {
        { "is_print_ready", reinterpret_cast<getter>(Print3DWorkflow_get_IsPrintReady), reinterpret_cast<setter>(Print3DWorkflow_put_IsPrintReady), nullptr, nullptr },
        { "device_id", reinterpret_cast<getter>(Print3DWorkflow_get_DeviceID), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_Print3DWorkflow[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_Print3DWorkflow) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_Print3DWorkflow) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_Print3DWorkflow) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_Print3DWorkflow) },
        { }};

    static PyType_Spec type_spec_Print3DWorkflow = {
        "winrt._winrt_windows_devices_printers_extensions.Print3DWorkflow",
        sizeof(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflow),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_Print3DWorkflow};

    // ----- Print3DWorkflowPrintRequestedEventArgs class --------------------

    static PyObject* _new_Print3DWorkflowPrintRequestedEventArgs(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Devices::Printers::Extensions::Print3DWorkflowPrintRequestedEventArgs>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::Printers::Extensions::Print3DWorkflowPrintRequestedEventArgs>::type_name);
        return nullptr;
    }

    static void _dealloc_Print3DWorkflowPrintRequestedEventArgs(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflowPrintRequestedEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* Print3DWorkflowPrintRequestedEventArgs_SetExtendedStatus(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflowPrintRequestedEventArgs* 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.Devices.Printers.Extensions.Print3DWorkflowPrintRequestedEventArgs", L"SetExtendedStatus", 1);
                }

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

                auto param0 = py::convert_to<winrt::Windows::Devices::Printers::Extensions::Print3DWorkflowDetail>(args, 0);

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

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

    static PyObject* Print3DWorkflowPrintRequestedEventArgs_SetSource(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflowPrintRequestedEventArgs* 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.Devices.Printers.Extensions.Print3DWorkflowPrintRequestedEventArgs", L"SetSource", 1);
                }

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

                auto param0 = py::convert_to<winrt::Windows::Foundation::IInspectable>(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* Print3DWorkflowPrintRequestedEventArgs_SetSourceChanged(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflowPrintRequestedEventArgs* 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.Devices.Printers.Extensions.Print3DWorkflowPrintRequestedEventArgs", L"SetSourceChanged", 1);
                }

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

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

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

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

    static PyObject* Print3DWorkflowPrintRequestedEventArgs_get_Status(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflowPrintRequestedEventArgs* 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.Devices.Printers.Extensions.Print3DWorkflowPrintRequestedEventArgs", L"Status");
            }

            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.Status();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_Print3DWorkflowPrintRequestedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Devices::Printers::Extensions::Print3DWorkflowPrintRequestedEventArgs>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_Print3DWorkflowPrintRequestedEventArgs(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::Devices::Printers::Extensions::Print3DWorkflowPrintRequestedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_Print3DWorkflowPrintRequestedEventArgs[] = {
        { "set_extended_status", reinterpret_cast<PyCFunction>(Print3DWorkflowPrintRequestedEventArgs_SetExtendedStatus), METH_VARARGS, nullptr },
        { "set_source", reinterpret_cast<PyCFunction>(Print3DWorkflowPrintRequestedEventArgs_SetSource), METH_VARARGS, nullptr },
        { "set_source_changed", reinterpret_cast<PyCFunction>(Print3DWorkflowPrintRequestedEventArgs_SetSourceChanged), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_Print3DWorkflowPrintRequestedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_Print3DWorkflowPrintRequestedEventArgs), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_Print3DWorkflowPrintRequestedEventArgs[] = {
        { "status", reinterpret_cast<getter>(Print3DWorkflowPrintRequestedEventArgs_get_Status), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_Print3DWorkflowPrintRequestedEventArgs[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_Print3DWorkflowPrintRequestedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_Print3DWorkflowPrintRequestedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_Print3DWorkflowPrintRequestedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_Print3DWorkflowPrintRequestedEventArgs) },
        { }};

    static PyType_Spec type_spec_Print3DWorkflowPrintRequestedEventArgs = {
        "winrt._winrt_windows_devices_printers_extensions.Print3DWorkflowPrintRequestedEventArgs",
        sizeof(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflowPrintRequestedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_Print3DWorkflowPrintRequestedEventArgs};

    // ----- Print3DWorkflowPrinterChangedEventArgs class --------------------

    static PyObject* _new_Print3DWorkflowPrinterChangedEventArgs(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Devices::Printers::Extensions::Print3DWorkflowPrinterChangedEventArgs>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::Printers::Extensions::Print3DWorkflowPrinterChangedEventArgs>::type_name);
        return nullptr;
    }

    static void _dealloc_Print3DWorkflowPrinterChangedEventArgs(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflowPrinterChangedEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* Print3DWorkflowPrinterChangedEventArgs_get_NewDeviceId(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflowPrinterChangedEventArgs* 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.Devices.Printers.Extensions.Print3DWorkflowPrinterChangedEventArgs", L"NewDeviceId");
            }

            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.NewDeviceId();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_Print3DWorkflowPrinterChangedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Devices::Printers::Extensions::Print3DWorkflowPrinterChangedEventArgs>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_Print3DWorkflowPrinterChangedEventArgs(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::Devices::Printers::Extensions::Print3DWorkflowPrinterChangedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_Print3DWorkflowPrinterChangedEventArgs[] = {
        { "_assign_array_", _assign_array_Print3DWorkflowPrinterChangedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_Print3DWorkflowPrinterChangedEventArgs), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_Print3DWorkflowPrinterChangedEventArgs[] = {
        { "new_device_id", reinterpret_cast<getter>(Print3DWorkflowPrinterChangedEventArgs_get_NewDeviceId), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_Print3DWorkflowPrinterChangedEventArgs[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_Print3DWorkflowPrinterChangedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_Print3DWorkflowPrinterChangedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_Print3DWorkflowPrinterChangedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_Print3DWorkflowPrinterChangedEventArgs) },
        { }};

    static PyType_Spec type_spec_Print3DWorkflowPrinterChangedEventArgs = {
        "winrt._winrt_windows_devices_printers_extensions.Print3DWorkflowPrinterChangedEventArgs",
        sizeof(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflowPrinterChangedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_Print3DWorkflowPrinterChangedEventArgs};

    // ----- PrintExtensionContext class --------------------

    static PyObject* _new_PrintExtensionContext(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Devices::Printers::Extensions::PrintExtensionContext>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::Printers::Extensions::PrintExtensionContext>::type_name);
        return nullptr;
    }

    static PyObject* PrintExtensionContext_FromDeviceId(PyObject* /*unused*/, 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.Devices.Printers.Extensions.PrintExtensionContext", L"FromDeviceId", 1);
                }

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

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

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return winrt::Windows::Devices::Printers::Extensions::PrintExtensionContext::FromDeviceId(param0);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyMethodDef _methods_PrintExtensionContext[] = {
        { }};

    static PyGetSetDef _getset_PrintExtensionContext[] = {
        { }};

    static PyType_Slot _type_slots_PrintExtensionContext[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintExtensionContext) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintExtensionContext) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintExtensionContext) },
        { }};

    static PyType_Spec type_spec_PrintExtensionContext = {
        "winrt._winrt_windows_devices_printers_extensions.PrintExtensionContext",
        0,
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintExtensionContext};

    static PyGetSetDef getset_PrintExtensionContext_Static[] = {
        { }};

    static PyMethodDef methods_PrintExtensionContext_Static[] = {
        { "from_device_id", reinterpret_cast<PyCFunction>(PrintExtensionContext_FromDeviceId), METH_VARARGS, nullptr },
        { }};

    static PyType_Slot type_slots_PrintExtensionContext_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_PrintExtensionContext_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_PrintExtensionContext_Static) },
        { }
    };

    static PyType_Spec type_spec_PrintExtensionContext_Static = {
        "winrt._winrt_windows_devices_printers_extensions.PrintExtensionContext_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_PrintExtensionContext_Static};

    // ----- PrintNotificationEventDetails class --------------------

    static PyObject* _new_PrintNotificationEventDetails(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Devices::Printers::Extensions::PrintNotificationEventDetails>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::Printers::Extensions::PrintNotificationEventDetails>::type_name);
        return nullptr;
    }

    static void _dealloc_PrintNotificationEventDetails(py::wrapper::Windows::Devices::Printers::Extensions::PrintNotificationEventDetails* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PrintNotificationEventDetails_get_EventData(py::wrapper::Windows::Devices::Printers::Extensions::PrintNotificationEventDetails* 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.Devices.Printers.Extensions.PrintNotificationEventDetails", L"EventData");
            }

            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.EventData();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PrintNotificationEventDetails_put_EventData(py::wrapper::Windows::Devices::Printers::Extensions::PrintNotificationEventDetails* 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.Devices.Printers.Extensions.PrintNotificationEventDetails", L"EventData");
            }

            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::hstring>(arg);

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

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

    static PyObject* PrintNotificationEventDetails_get_PrinterName(py::wrapper::Windows::Devices::Printers::Extensions::PrintNotificationEventDetails* 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.Devices.Printers.Extensions.PrintNotificationEventDetails", L"PrinterName");
            }

            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.PrinterName();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_PrintNotificationEventDetails(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Devices::Printers::Extensions::PrintNotificationEventDetails>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_PrintNotificationEventDetails(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::Devices::Printers::Extensions::PrintNotificationEventDetails>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PrintNotificationEventDetails[] = {
        { "_assign_array_", _assign_array_PrintNotificationEventDetails, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PrintNotificationEventDetails), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_PrintNotificationEventDetails[] = {
        { "event_data", reinterpret_cast<getter>(PrintNotificationEventDetails_get_EventData), reinterpret_cast<setter>(PrintNotificationEventDetails_put_EventData), nullptr, nullptr },
        { "printer_name", reinterpret_cast<getter>(PrintNotificationEventDetails_get_PrinterName), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_PrintNotificationEventDetails[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintNotificationEventDetails) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PrintNotificationEventDetails) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintNotificationEventDetails) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintNotificationEventDetails) },
        { }};

    static PyType_Spec type_spec_PrintNotificationEventDetails = {
        "winrt._winrt_windows_devices_printers_extensions.PrintNotificationEventDetails",
        sizeof(py::wrapper::Windows::Devices::Printers::Extensions::PrintNotificationEventDetails),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintNotificationEventDetails};

    // ----- PrintTaskConfiguration class --------------------

    static PyObject* _new_PrintTaskConfiguration(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Devices::Printers::Extensions::PrintTaskConfiguration>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::Printers::Extensions::PrintTaskConfiguration>::type_name);
        return nullptr;
    }

    static void _dealloc_PrintTaskConfiguration(py::wrapper::Windows::Devices::Printers::Extensions::PrintTaskConfiguration* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PrintTaskConfiguration_get_PrinterExtensionContext(py::wrapper::Windows::Devices::Printers::Extensions::PrintTaskConfiguration* 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.Devices.Printers.Extensions.PrintTaskConfiguration", L"PrinterExtensionContext");
            }

            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.PrinterExtensionContext();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PrintTaskConfiguration_add_SaveRequested(py::wrapper::Windows::Devices::Printers::Extensions::PrintTaskConfiguration* 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.Devices.Printers.Extensions.PrintTaskConfiguration", L"SaveRequested");
            }

            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::Devices::Printers::Extensions::PrintTaskConfiguration, winrt::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequestedEventArgs>>(arg);

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

    static PyObject* PrintTaskConfiguration_remove_SaveRequested(py::wrapper::Windows::Devices::Printers::Extensions::PrintTaskConfiguration* 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.Devices.Printers.Extensions.PrintTaskConfiguration", L"SaveRequested");
            }

            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.SaveRequested(param0);
            }

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

    static PyObject* _assign_array_PrintTaskConfiguration(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Devices::Printers::Extensions::PrintTaskConfiguration>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_PrintTaskConfiguration(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::Devices::Printers::Extensions::PrintTaskConfiguration>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PrintTaskConfiguration[] = {
        { "add_save_requested", reinterpret_cast<PyCFunction>(PrintTaskConfiguration_add_SaveRequested), METH_O, nullptr },
        { "remove_save_requested", reinterpret_cast<PyCFunction>(PrintTaskConfiguration_remove_SaveRequested), METH_O, nullptr },
        { "_assign_array_", _assign_array_PrintTaskConfiguration, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PrintTaskConfiguration), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_PrintTaskConfiguration[] = {
        { "printer_extension_context", reinterpret_cast<getter>(PrintTaskConfiguration_get_PrinterExtensionContext), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_PrintTaskConfiguration[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintTaskConfiguration) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PrintTaskConfiguration) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintTaskConfiguration) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintTaskConfiguration) },
        { }};

    static PyType_Spec type_spec_PrintTaskConfiguration = {
        "winrt._winrt_windows_devices_printers_extensions.PrintTaskConfiguration",
        sizeof(py::wrapper::Windows::Devices::Printers::Extensions::PrintTaskConfiguration),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintTaskConfiguration};

    // ----- PrintTaskConfigurationSaveRequest class --------------------

    static PyObject* _new_PrintTaskConfigurationSaveRequest(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequest>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequest>::type_name);
        return nullptr;
    }

    static void _dealloc_PrintTaskConfigurationSaveRequest(py::wrapper::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequest* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PrintTaskConfigurationSaveRequest_Cancel(py::wrapper::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequest* 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.Devices.Printers.Extensions.PrintTaskConfigurationSaveRequest", L"Cancel", 0);
                }

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

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

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

    static PyObject* PrintTaskConfigurationSaveRequest_GetDeferral(py::wrapper::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequest* 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.Devices.Printers.Extensions.PrintTaskConfigurationSaveRequest", 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* PrintTaskConfigurationSaveRequest_Save(py::wrapper::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequest* 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.Devices.Printers.Extensions.PrintTaskConfigurationSaveRequest", L"Save", 1);
                }

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

                auto param0 = py::convert_to<winrt::Windows::Foundation::IInspectable>(args, 0);

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

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

    static PyObject* PrintTaskConfigurationSaveRequest_get_Deadline(py::wrapper::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequest* 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.Devices.Printers.Extensions.PrintTaskConfigurationSaveRequest", 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_PrintTaskConfigurationSaveRequest(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequest>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_PrintTaskConfigurationSaveRequest(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::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequest>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PrintTaskConfigurationSaveRequest[] = {
        { "cancel", reinterpret_cast<PyCFunction>(PrintTaskConfigurationSaveRequest_Cancel), METH_VARARGS, nullptr },
        { "get_deferral", reinterpret_cast<PyCFunction>(PrintTaskConfigurationSaveRequest_GetDeferral), METH_VARARGS, nullptr },
        { "save", reinterpret_cast<PyCFunction>(PrintTaskConfigurationSaveRequest_Save), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_PrintTaskConfigurationSaveRequest, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PrintTaskConfigurationSaveRequest), METH_O | METH_STATIC, nullptr },
        { }};

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

    static PyType_Slot _type_slots_PrintTaskConfigurationSaveRequest[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintTaskConfigurationSaveRequest) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PrintTaskConfigurationSaveRequest) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintTaskConfigurationSaveRequest) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintTaskConfigurationSaveRequest) },
        { }};

    static PyType_Spec type_spec_PrintTaskConfigurationSaveRequest = {
        "winrt._winrt_windows_devices_printers_extensions.PrintTaskConfigurationSaveRequest",
        sizeof(py::wrapper::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequest),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintTaskConfigurationSaveRequest};

    // ----- PrintTaskConfigurationSaveRequestedDeferral class --------------------

    static PyObject* _new_PrintTaskConfigurationSaveRequestedDeferral(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequestedDeferral>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequestedDeferral>::type_name);
        return nullptr;
    }

    static void _dealloc_PrintTaskConfigurationSaveRequestedDeferral(py::wrapper::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequestedDeferral* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PrintTaskConfigurationSaveRequestedDeferral_Complete(py::wrapper::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequestedDeferral* 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.Devices.Printers.Extensions.PrintTaskConfigurationSaveRequestedDeferral", 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_PrintTaskConfigurationSaveRequestedDeferral(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequestedDeferral>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_PrintTaskConfigurationSaveRequestedDeferral(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::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequestedDeferral>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PrintTaskConfigurationSaveRequestedDeferral[] = {
        { "complete", reinterpret_cast<PyCFunction>(PrintTaskConfigurationSaveRequestedDeferral_Complete), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_PrintTaskConfigurationSaveRequestedDeferral, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PrintTaskConfigurationSaveRequestedDeferral), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_PrintTaskConfigurationSaveRequestedDeferral[] = {
        { }};

    static PyType_Slot _type_slots_PrintTaskConfigurationSaveRequestedDeferral[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintTaskConfigurationSaveRequestedDeferral) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PrintTaskConfigurationSaveRequestedDeferral) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintTaskConfigurationSaveRequestedDeferral) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintTaskConfigurationSaveRequestedDeferral) },
        { }};

    static PyType_Spec type_spec_PrintTaskConfigurationSaveRequestedDeferral = {
        "winrt._winrt_windows_devices_printers_extensions.PrintTaskConfigurationSaveRequestedDeferral",
        sizeof(py::wrapper::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequestedDeferral),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintTaskConfigurationSaveRequestedDeferral};

    // ----- PrintTaskConfigurationSaveRequestedEventArgs class --------------------

    static PyObject* _new_PrintTaskConfigurationSaveRequestedEventArgs(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequestedEventArgs>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequestedEventArgs>::type_name);
        return nullptr;
    }

    static void _dealloc_PrintTaskConfigurationSaveRequestedEventArgs(py::wrapper::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequestedEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PrintTaskConfigurationSaveRequestedEventArgs_get_Request(py::wrapper::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequestedEventArgs* 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.Devices.Printers.Extensions.PrintTaskConfigurationSaveRequestedEventArgs", 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_PrintTaskConfigurationSaveRequestedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequestedEventArgs>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_PrintTaskConfigurationSaveRequestedEventArgs(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::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequestedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PrintTaskConfigurationSaveRequestedEventArgs[] = {
        { "_assign_array_", _assign_array_PrintTaskConfigurationSaveRequestedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PrintTaskConfigurationSaveRequestedEventArgs), METH_O | METH_STATIC, nullptr },
        { }};

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

    static PyType_Slot _type_slots_PrintTaskConfigurationSaveRequestedEventArgs[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PrintTaskConfigurationSaveRequestedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PrintTaskConfigurationSaveRequestedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PrintTaskConfigurationSaveRequestedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PrintTaskConfigurationSaveRequestedEventArgs) },
        { }};

    static PyType_Spec type_spec_PrintTaskConfigurationSaveRequestedEventArgs = {
        "winrt._winrt_windows_devices_printers_extensions.PrintTaskConfigurationSaveRequestedEventArgs",
        sizeof(py::wrapper::Windows::Devices::Printers::Extensions::PrintTaskConfigurationSaveRequestedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PrintTaskConfigurationSaveRequestedEventArgs};

    // ----- Windows.Devices.Printers.Extensions Initialization --------------------

    PyDoc_STRVAR(module_doc, "Windows.Devices.Printers.Extensions");

    static PyModuleDef module_def = {
        PyModuleDef_HEAD_INIT,
        "_winrt_windows_devices_printers_extensions",
        module_doc,
        0,
        nullptr,
        nullptr,
        nullptr,
        nullptr,
        nullptr};
} // py::cpp::Windows::Devices::Printers::Extensions

PyMODINIT_FUNC PyInit__winrt_windows_devices_printers_extensions(void) noexcept
{
    using namespace py::cpp::Windows::Devices::Printers::Extensions;

    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::pytype_handle Print3DWorkflow_type{py::register_python_type(module.get(), &type_spec_Print3DWorkflow, object_bases.get(), inspectable_meta_type)};
    if (!Print3DWorkflow_type)
    {
        return nullptr;
    }

    py::pytype_handle Print3DWorkflowPrintRequestedEventArgs_type{py::register_python_type(module.get(), &type_spec_Print3DWorkflowPrintRequestedEventArgs, object_bases.get(), inspectable_meta_type)};
    if (!Print3DWorkflowPrintRequestedEventArgs_type)
    {
        return nullptr;
    }

    py::pytype_handle Print3DWorkflowPrinterChangedEventArgs_type{py::register_python_type(module.get(), &type_spec_Print3DWorkflowPrinterChangedEventArgs, object_bases.get(), inspectable_meta_type)};
    if (!Print3DWorkflowPrinterChangedEventArgs_type)
    {
        return nullptr;
    }

    py::pyobj_handle PrintExtensionContext_Static_bases{PyTuple_Pack(1, reinterpret_cast<PyObject*>(inspectable_meta_type))};
    if (!PrintExtensionContext_Static_bases)
    {
        return nullptr;
    }

    py::pyobj_handle type_PrintExtensionContext_Static{PyType_FromSpecWithBases(&type_spec_PrintExtensionContext_Static, PrintExtensionContext_Static_bases.get())};
    if (!type_PrintExtensionContext_Static)
    {
        return nullptr;
    }

    py::pytype_handle PrintExtensionContext_type{py::register_python_type(module.get(), &type_spec_PrintExtensionContext, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_PrintExtensionContext_Static.get()))};
    if (!PrintExtensionContext_type)
    {
        return nullptr;
    }

    py::pytype_handle PrintNotificationEventDetails_type{py::register_python_type(module.get(), &type_spec_PrintNotificationEventDetails, object_bases.get(), inspectable_meta_type)};
    if (!PrintNotificationEventDetails_type)
    {
        return nullptr;
    }

    py::pytype_handle PrintTaskConfiguration_type{py::register_python_type(module.get(), &type_spec_PrintTaskConfiguration, object_bases.get(), inspectable_meta_type)};
    if (!PrintTaskConfiguration_type)
    {
        return nullptr;
    }

    py::pytype_handle PrintTaskConfigurationSaveRequest_type{py::register_python_type(module.get(), &type_spec_PrintTaskConfigurationSaveRequest, object_bases.get(), inspectable_meta_type)};
    if (!PrintTaskConfigurationSaveRequest_type)
    {
        return nullptr;
    }

    py::pytype_handle PrintTaskConfigurationSaveRequestedDeferral_type{py::register_python_type(module.get(), &type_spec_PrintTaskConfigurationSaveRequestedDeferral, object_bases.get(), inspectable_meta_type)};
    if (!PrintTaskConfigurationSaveRequestedDeferral_type)
    {
        return nullptr;
    }

    py::pytype_handle PrintTaskConfigurationSaveRequestedEventArgs_type{py::register_python_type(module.get(), &type_spec_PrintTaskConfigurationSaveRequestedEventArgs, object_bases.get(), inspectable_meta_type)};
    if (!PrintTaskConfigurationSaveRequestedEventArgs_type)
    {
        return nullptr;
    }


    return module.detach();
}
