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

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

PyTypeObject* py::winrt_type<winrt::Windows::Devices::Printers::Extensions::Print3DWorkflow>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Devices::Printers::Extensions::Print3DWorkflowPrintRequestedEventArgs>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Devices::Printers::Extensions::Print3DWorkflowPrinterChangedEventArgs>::python_type;

namespace py::cpp::Windows::Devices::Printers::Extensions
{
    // ----- Print3DWorkflow class --------------------
    constexpr const char* const _type_name_Print3DWorkflow = "Print3DWorkflow";

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

    static void _dealloc_Print3DWorkflow(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflow* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* Print3DWorkflow_GetPrintModelPackage(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflow* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                return py::convert(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
        {
            return py::convert(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 == nullptr)
        {
            PyErr_SetString(PyExc_TypeError, "property delete not supported");
            return -1;
        }

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

            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
        {
            return py::convert(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
        {
            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(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
        {
            auto param0 = py::convert_to<winrt::event_token>(arg);

            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
        {
            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(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
        {
            auto param0 = py::convert_to<winrt::event_token>(arg);

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

    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 },
        { "_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_i_d", reinterpret_cast<getter>(Print3DWorkflow_get_DeviceID), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_Print3DWorkflow[] = 
    {
        { Py_tp_new, _new_Print3DWorkflow },
        { Py_tp_dealloc, _dealloc_Print3DWorkflow },
        { Py_tp_methods, _methods_Print3DWorkflow },
        { Py_tp_getset, _getset_Print3DWorkflow },
        { },
    };

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

    // ----- Print3DWorkflowPrintRequestedEventArgs class --------------------
    constexpr const char* const _type_name_Print3DWorkflowPrintRequestedEventArgs = "Print3DWorkflowPrintRequestedEventArgs";

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

    static void _dealloc_Print3DWorkflowPrintRequestedEventArgs(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflowPrintRequestedEventArgs* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* Print3DWorkflowPrintRequestedEventArgs_SetExtendedStatus(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflowPrintRequestedEventArgs* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

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

                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
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

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

                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
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

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

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

    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 },
        { "_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, _new_Print3DWorkflowPrintRequestedEventArgs },
        { Py_tp_dealloc, _dealloc_Print3DWorkflowPrintRequestedEventArgs },
        { Py_tp_methods, _methods_Print3DWorkflowPrintRequestedEventArgs },
        { Py_tp_getset, _getset_Print3DWorkflowPrintRequestedEventArgs },
        { },
    };

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

    // ----- Print3DWorkflowPrinterChangedEventArgs class --------------------
    constexpr const char* const _type_name_Print3DWorkflowPrinterChangedEventArgs = "Print3DWorkflowPrinterChangedEventArgs";

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

    static void _dealloc_Print3DWorkflowPrinterChangedEventArgs(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflowPrinterChangedEventArgs* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* Print3DWorkflowPrinterChangedEventArgs_get_NewDeviceId(py::wrapper::Windows::Devices::Printers::Extensions::Print3DWorkflowPrinterChangedEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.NewDeviceId());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    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[] = {
        { "_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, _new_Print3DWorkflowPrinterChangedEventArgs },
        { Py_tp_dealloc, _dealloc_Print3DWorkflowPrinterChangedEventArgs },
        { Py_tp_methods, _methods_Print3DWorkflowPrinterChangedEventArgs },
        { Py_tp_getset, _getset_Print3DWorkflowPrinterChangedEventArgs },
        { },
    };

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

    // ----- Windows.Devices.Printers.Extensions Initialization --------------------
    static int module_exec(PyObject* module) noexcept
    {
        try
        {
            py::pyobj_handle bases { PyTuple_Pack(1, py::winrt_type<py::Object>::python_type) };

            py::winrt_type<winrt::Windows::Devices::Printers::Extensions::Print3DWorkflow>::python_type = py::register_python_type(module, _type_name_Print3DWorkflow, &_type_spec_Print3DWorkflow, bases.get());
            py::winrt_type<winrt::Windows::Devices::Printers::Extensions::Print3DWorkflowPrintRequestedEventArgs>::python_type = py::register_python_type(module, _type_name_Print3DWorkflowPrintRequestedEventArgs, &_type_spec_Print3DWorkflowPrintRequestedEventArgs, bases.get());
            py::winrt_type<winrt::Windows::Devices::Printers::Extensions::Print3DWorkflowPrinterChangedEventArgs>::python_type = py::register_python_type(module, _type_name_Print3DWorkflowPrinterChangedEventArgs, &_type_spec_Print3DWorkflowPrinterChangedEventArgs, bases.get());

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

    static PyModuleDef_Slot module_slots[] = {{Py_mod_exec, module_exec}, {}};

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

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

PyMODINIT_FUNC
PyInit__winsdk_Windows_Devices_Printers_Extensions (void) noexcept
{
    return PyModuleDef_Init(&py::cpp::Windows::Devices::Printers::Extensions::module_def);
}
