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

#include "py.Windows.AI.Actions.Hosting.h"

namespace py::cpp::Windows::AI::Actions::Hosting
{
    // ----- ActionCatalog class --------------------

    static PyObject* _new_ActionCatalog(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::AI::Actions::Hosting::ActionCatalog>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::AI::Actions::Hosting::ActionCatalog>::type_name);
        return nullptr;
    }

    static void _dealloc_ActionCatalog(py::wrapper::Windows::AI::Actions::Hosting::ActionCatalog* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* ActionCatalog_Close(py::wrapper::Windows::AI::Actions::Hosting::ActionCatalog* 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.AI.Actions.Hosting.ActionCatalog", L"Close", 0);
                }

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

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

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

    static PyObject* ActionCatalog_GetActionsForInputs(py::wrapper::Windows::AI::Actions::Hosting::ActionCatalog* 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.AI.Actions.Hosting.ActionCatalog", L"GetActionsForInputs", 1);
                }

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

                auto param0 = py::convert_to<py::pybuf_view<winrt::Windows::AI::Actions::ActionEntity, false>>(args, 0);

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

    static PyObject* ActionCatalog_GetActionsForInputs2(py::wrapper::Windows::AI::Actions::Hosting::ActionCatalog* 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.AI.Actions.Hosting.ActionCatalog", L"GetActionsForInputs", 2);
                }

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

                auto param0 = py::convert_to<py::pybuf_view<winrt::Windows::AI::Actions::ActionEntity, false>>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::UI::WindowId>(args, 1);

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

    static PyObject* ActionCatalog_GetAllActions(py::wrapper::Windows::AI::Actions::Hosting::ActionCatalog* 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.AI.Actions.Hosting.ActionCatalog", L"GetAllActions", 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.GetAllActions();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* ActionCatalog_add_Changed(py::wrapper::Windows::AI::Actions::Hosting::ActionCatalog* 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.AI.Actions.Hosting.ActionCatalog", L"Changed");
            }

            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::AI::Actions::Hosting::ActionCatalog, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* ActionCatalog_remove_Changed(py::wrapper::Windows::AI::Actions::Hosting::ActionCatalog* 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.AI.Actions.Hosting.ActionCatalog", L"Changed");
            }

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

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

    static PyObject* _assign_array_ActionCatalog(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::AI::Actions::Hosting::ActionCatalog>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_ActionCatalog(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::AI::Actions::Hosting::ActionCatalog>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _enter_ActionCatalog(py::wrapper::Windows::AI::Actions::Hosting::ActionCatalog* self, PyObject* /*unused*/) noexcept
    {
        return Py_NewRef(self);
    }

    static PyObject* _exit_ActionCatalog(py::wrapper::Windows::AI::Actions::Hosting::ActionCatalog* self, PyObject* /*unused*/) noexcept
    {
        try
        {
            {
                auto _gil = py::release_gil();
                self->obj.Close();
            }

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

    static PyMethodDef _methods_ActionCatalog[] = {
        { "close", reinterpret_cast<PyCFunction>(ActionCatalog_Close), METH_VARARGS, nullptr },
        { "get_actions_for_inputs", reinterpret_cast<PyCFunction>(ActionCatalog_GetActionsForInputs), METH_VARARGS, nullptr },
        { "get_actions_for_inputs2", reinterpret_cast<PyCFunction>(ActionCatalog_GetActionsForInputs2), METH_VARARGS, nullptr },
        { "get_all_actions", reinterpret_cast<PyCFunction>(ActionCatalog_GetAllActions), METH_VARARGS, nullptr },
        { "add_changed", reinterpret_cast<PyCFunction>(ActionCatalog_add_Changed), METH_O, nullptr },
        { "remove_changed", reinterpret_cast<PyCFunction>(ActionCatalog_remove_Changed), METH_O, nullptr },
        { "_assign_array_", _assign_array_ActionCatalog, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_ActionCatalog), METH_O | METH_STATIC, nullptr },
        { "__enter__", reinterpret_cast<PyCFunction>(_enter_ActionCatalog), METH_NOARGS, nullptr },
        { "__exit__", reinterpret_cast<PyCFunction>(_exit_ActionCatalog), METH_VARARGS, nullptr },
        { }};

    static PyGetSetDef _getset_ActionCatalog[] = {
        { }};

    static PyType_Slot _type_slots_ActionCatalog[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_ActionCatalog) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_ActionCatalog) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_ActionCatalog) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_ActionCatalog) },
        { }};

    static PyType_Spec type_spec_ActionCatalog = {
        "winrt._winrt_windows_ai_actions_hosting.ActionCatalog",
        sizeof(py::wrapper::Windows::AI::Actions::Hosting::ActionCatalog),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_ActionCatalog};

    // ----- ActionDefinition class --------------------

    static PyObject* _new_ActionDefinition(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::AI::Actions::Hosting::ActionDefinition>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::AI::Actions::Hosting::ActionDefinition>::type_name);
        return nullptr;
    }

    static void _dealloc_ActionDefinition(py::wrapper::Windows::AI::Actions::Hosting::ActionDefinition* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* ActionDefinition_Close(py::wrapper::Windows::AI::Actions::Hosting::ActionDefinition* 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.AI.Actions.Hosting.ActionDefinition", L"Close", 0);
                }

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

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

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

    static PyObject* ActionDefinition_GetInputs(py::wrapper::Windows::AI::Actions::Hosting::ActionDefinition* 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.AI.Actions.Hosting.ActionDefinition", L"GetInputs", 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.GetInputs();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* ActionDefinition_GetOutputs(py::wrapper::Windows::AI::Actions::Hosting::ActionDefinition* 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.AI.Actions.Hosting.ActionDefinition", L"GetOutputs", 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.GetOutputs();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* ActionDefinition_GetOverloads(py::wrapper::Windows::AI::Actions::Hosting::ActionDefinition* 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.AI.Actions.Hosting.ActionDefinition", L"GetOverloads", 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.GetOverloads();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* ActionDefinition_get_Description(py::wrapper::Windows::AI::Actions::Hosting::ActionDefinition* 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.AI.Actions.Hosting.ActionDefinition", L"Description");
            }

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

    static PyObject* ActionDefinition_get_IconFullPath(py::wrapper::Windows::AI::Actions::Hosting::ActionDefinition* 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.AI.Actions.Hosting.ActionDefinition", L"IconFullPath");
            }

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

    static PyObject* ActionDefinition_get_Id(py::wrapper::Windows::AI::Actions::Hosting::ActionDefinition* 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.AI.Actions.Hosting.ActionDefinition", L"Id");
            }

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

    static PyObject* ActionDefinition_get_PackageFamilyName(py::wrapper::Windows::AI::Actions::Hosting::ActionDefinition* 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.AI.Actions.Hosting.ActionDefinition", L"PackageFamilyName");
            }

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

    static PyObject* ActionDefinition_get_DisplaysUI(py::wrapper::Windows::AI::Actions::Hosting::ActionDefinition* 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.AI.Actions.Hosting.ActionDefinition", L"DisplaysUI");
            }

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

    static PyObject* ActionDefinition_get_SchemaVersion(py::wrapper::Windows::AI::Actions::Hosting::ActionDefinition* 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.AI.Actions.Hosting.ActionDefinition", L"SchemaVersion");
            }

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

    static PyObject* ActionDefinition_get_UsesGenerativeAI(py::wrapper::Windows::AI::Actions::Hosting::ActionDefinition* 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.AI.Actions.Hosting.ActionDefinition", L"UsesGenerativeAI");
            }

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

    static PyObject* ActionDefinition_get_PackageRelativeApplicationId(py::wrapper::Windows::AI::Actions::Hosting::ActionDefinition* 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.AI.Actions.Hosting.ActionDefinition", L"PackageRelativeApplicationId");
            }

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

    static PyObject* _assign_array_ActionDefinition(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::AI::Actions::Hosting::ActionDefinition>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_ActionDefinition(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::AI::Actions::Hosting::ActionDefinition>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _enter_ActionDefinition(py::wrapper::Windows::AI::Actions::Hosting::ActionDefinition* self, PyObject* /*unused*/) noexcept
    {
        return Py_NewRef(self);
    }

    static PyObject* _exit_ActionDefinition(py::wrapper::Windows::AI::Actions::Hosting::ActionDefinition* self, PyObject* /*unused*/) noexcept
    {
        try
        {
            {
                auto _gil = py::release_gil();
                self->obj.Close();
            }

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

    static PyMethodDef _methods_ActionDefinition[] = {
        { "close", reinterpret_cast<PyCFunction>(ActionDefinition_Close), METH_VARARGS, nullptr },
        { "get_inputs", reinterpret_cast<PyCFunction>(ActionDefinition_GetInputs), METH_VARARGS, nullptr },
        { "get_outputs", reinterpret_cast<PyCFunction>(ActionDefinition_GetOutputs), METH_VARARGS, nullptr },
        { "get_overloads", reinterpret_cast<PyCFunction>(ActionDefinition_GetOverloads), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_ActionDefinition, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_ActionDefinition), METH_O | METH_STATIC, nullptr },
        { "__enter__", reinterpret_cast<PyCFunction>(_enter_ActionDefinition), METH_NOARGS, nullptr },
        { "__exit__", reinterpret_cast<PyCFunction>(_exit_ActionDefinition), METH_VARARGS, nullptr },
        { }};

    static PyGetSetDef _getset_ActionDefinition[] = {
        { "description", reinterpret_cast<getter>(ActionDefinition_get_Description), nullptr, nullptr, nullptr },
        { "icon_full_path", reinterpret_cast<getter>(ActionDefinition_get_IconFullPath), nullptr, nullptr, nullptr },
        { "id", reinterpret_cast<getter>(ActionDefinition_get_Id), nullptr, nullptr, nullptr },
        { "package_family_name", reinterpret_cast<getter>(ActionDefinition_get_PackageFamilyName), nullptr, nullptr, nullptr },
        { "displays_ui", reinterpret_cast<getter>(ActionDefinition_get_DisplaysUI), nullptr, nullptr, nullptr },
        { "schema_version", reinterpret_cast<getter>(ActionDefinition_get_SchemaVersion), nullptr, nullptr, nullptr },
        { "uses_generative_a_i", reinterpret_cast<getter>(ActionDefinition_get_UsesGenerativeAI), nullptr, nullptr, nullptr },
        { "package_relative_application_id", reinterpret_cast<getter>(ActionDefinition_get_PackageRelativeApplicationId), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_ActionDefinition[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_ActionDefinition) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_ActionDefinition) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_ActionDefinition) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_ActionDefinition) },
        { }};

    static PyType_Spec type_spec_ActionDefinition = {
        "winrt._winrt_windows_ai_actions_hosting.ActionDefinition",
        sizeof(py::wrapper::Windows::AI::Actions::Hosting::ActionDefinition),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_ActionDefinition};

    // ----- ActionEntityRegistrationInfo class --------------------

    static PyObject* _new_ActionEntityRegistrationInfo(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::AI::Actions::Hosting::ActionEntityRegistrationInfo>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::AI::Actions::Hosting::ActionEntityRegistrationInfo>::type_name);
        return nullptr;
    }

    static void _dealloc_ActionEntityRegistrationInfo(py::wrapper::Windows::AI::Actions::Hosting::ActionEntityRegistrationInfo* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* ActionEntityRegistrationInfo_Close(py::wrapper::Windows::AI::Actions::Hosting::ActionEntityRegistrationInfo* 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.AI.Actions.Hosting.ActionEntityRegistrationInfo", L"Close", 0);
                }

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

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

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

    static PyObject* ActionEntityRegistrationInfo_get_Name(py::wrapper::Windows::AI::Actions::Hosting::ActionEntityRegistrationInfo* 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.AI.Actions.Hosting.ActionEntityRegistrationInfo", L"Name");
            }

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

    static int ActionEntityRegistrationInfo_put_Name(py::wrapper::Windows::AI::Actions::Hosting::ActionEntityRegistrationInfo* 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.AI.Actions.Hosting.ActionEntityRegistrationInfo", L"Name");
            }

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

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

    static PyObject* ActionEntityRegistrationInfo_get_Kind(py::wrapper::Windows::AI::Actions::Hosting::ActionEntityRegistrationInfo* 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.AI.Actions.Hosting.ActionEntityRegistrationInfo", L"Kind");
            }

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

    static int ActionEntityRegistrationInfo_put_Kind(py::wrapper::Windows::AI::Actions::Hosting::ActionEntityRegistrationInfo* 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.AI.Actions.Hosting.ActionEntityRegistrationInfo", L"Kind");
            }

            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::AI::Actions::ActionEntityKind>(arg);

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

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

    static PyObject* _assign_array_ActionEntityRegistrationInfo(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::AI::Actions::Hosting::ActionEntityRegistrationInfo>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_ActionEntityRegistrationInfo(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::AI::Actions::Hosting::ActionEntityRegistrationInfo>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _enter_ActionEntityRegistrationInfo(py::wrapper::Windows::AI::Actions::Hosting::ActionEntityRegistrationInfo* self, PyObject* /*unused*/) noexcept
    {
        return Py_NewRef(self);
    }

    static PyObject* _exit_ActionEntityRegistrationInfo(py::wrapper::Windows::AI::Actions::Hosting::ActionEntityRegistrationInfo* self, PyObject* /*unused*/) noexcept
    {
        try
        {
            {
                auto _gil = py::release_gil();
                self->obj.Close();
            }

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

    static PyMethodDef _methods_ActionEntityRegistrationInfo[] = {
        { "close", reinterpret_cast<PyCFunction>(ActionEntityRegistrationInfo_Close), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_ActionEntityRegistrationInfo, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_ActionEntityRegistrationInfo), METH_O | METH_STATIC, nullptr },
        { "__enter__", reinterpret_cast<PyCFunction>(_enter_ActionEntityRegistrationInfo), METH_NOARGS, nullptr },
        { "__exit__", reinterpret_cast<PyCFunction>(_exit_ActionEntityRegistrationInfo), METH_VARARGS, nullptr },
        { }};

    static PyGetSetDef _getset_ActionEntityRegistrationInfo[] = {
        { "name", reinterpret_cast<getter>(ActionEntityRegistrationInfo_get_Name), reinterpret_cast<setter>(ActionEntityRegistrationInfo_put_Name), nullptr, nullptr },
        { "kind", reinterpret_cast<getter>(ActionEntityRegistrationInfo_get_Kind), reinterpret_cast<setter>(ActionEntityRegistrationInfo_put_Kind), nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_ActionEntityRegistrationInfo[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_ActionEntityRegistrationInfo) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_ActionEntityRegistrationInfo) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_ActionEntityRegistrationInfo) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_ActionEntityRegistrationInfo) },
        { }};

    static PyType_Spec type_spec_ActionEntityRegistrationInfo = {
        "winrt._winrt_windows_ai_actions_hosting.ActionEntityRegistrationInfo",
        sizeof(py::wrapper::Windows::AI::Actions::Hosting::ActionEntityRegistrationInfo),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_ActionEntityRegistrationInfo};

    // ----- ActionInstance class --------------------

    static PyObject* _new_ActionInstance(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::AI::Actions::Hosting::ActionInstance>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::AI::Actions::Hosting::ActionInstance>::type_name);
        return nullptr;
    }

    static void _dealloc_ActionInstance(py::wrapper::Windows::AI::Actions::Hosting::ActionInstance* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* ActionInstance_InvokeAsync(py::wrapper::Windows::AI::Actions::Hosting::ActionInstance* 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.AI.Actions.Hosting.ActionInstance", L"InvokeAsync", 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.InvokeAsync();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* ActionInstance_get_Context(py::wrapper::Windows::AI::Actions::Hosting::ActionInstance* 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.AI.Actions.Hosting.ActionInstance", L"Context");
            }

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

    static PyObject* ActionInstance_get_Definition(py::wrapper::Windows::AI::Actions::Hosting::ActionInstance* 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.AI.Actions.Hosting.ActionInstance", L"Definition");
            }

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

    static PyObject* ActionInstance_get_DisplayInfo(py::wrapper::Windows::AI::Actions::Hosting::ActionInstance* 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.AI.Actions.Hosting.ActionInstance", L"DisplayInfo");
            }

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

    static PyObject* _assign_array_ActionInstance(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::AI::Actions::Hosting::ActionInstance>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_ActionInstance(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::AI::Actions::Hosting::ActionInstance>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_ActionInstance[] = {
        { "invoke_async", reinterpret_cast<PyCFunction>(ActionInstance_InvokeAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_ActionInstance, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_ActionInstance), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_ActionInstance[] = {
        { "context", reinterpret_cast<getter>(ActionInstance_get_Context), nullptr, nullptr, nullptr },
        { "definition", reinterpret_cast<getter>(ActionInstance_get_Definition), nullptr, nullptr, nullptr },
        { "display_info", reinterpret_cast<getter>(ActionInstance_get_DisplayInfo), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_ActionInstance[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_ActionInstance) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_ActionInstance) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_ActionInstance) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_ActionInstance) },
        { }};

    static PyType_Spec type_spec_ActionInstance = {
        "winrt._winrt_windows_ai_actions_hosting.ActionInstance",
        sizeof(py::wrapper::Windows::AI::Actions::Hosting::ActionInstance),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_ActionInstance};

    // ----- ActionInstanceDisplayInfo class --------------------

    static PyObject* _new_ActionInstanceDisplayInfo(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::AI::Actions::Hosting::ActionInstanceDisplayInfo>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::AI::Actions::Hosting::ActionInstanceDisplayInfo>::type_name);
        return nullptr;
    }

    static void _dealloc_ActionInstanceDisplayInfo(py::wrapper::Windows::AI::Actions::Hosting::ActionInstanceDisplayInfo* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* ActionInstanceDisplayInfo_get_Description(py::wrapper::Windows::AI::Actions::Hosting::ActionInstanceDisplayInfo* 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.AI.Actions.Hosting.ActionInstanceDisplayInfo", L"Description");
            }

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

    static PyObject* _assign_array_ActionInstanceDisplayInfo(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::AI::Actions::Hosting::ActionInstanceDisplayInfo>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_ActionInstanceDisplayInfo(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::AI::Actions::Hosting::ActionInstanceDisplayInfo>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_ActionInstanceDisplayInfo[] = {
        { "_assign_array_", _assign_array_ActionInstanceDisplayInfo, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_ActionInstanceDisplayInfo), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_ActionInstanceDisplayInfo[] = {
        { "description", reinterpret_cast<getter>(ActionInstanceDisplayInfo_get_Description), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_ActionInstanceDisplayInfo[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_ActionInstanceDisplayInfo) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_ActionInstanceDisplayInfo) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_ActionInstanceDisplayInfo) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_ActionInstanceDisplayInfo) },
        { }};

    static PyType_Spec type_spec_ActionInstanceDisplayInfo = {
        "winrt._winrt_windows_ai_actions_hosting.ActionInstanceDisplayInfo",
        sizeof(py::wrapper::Windows::AI::Actions::Hosting::ActionInstanceDisplayInfo),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_ActionInstanceDisplayInfo};

    // ----- ActionOverload class --------------------

    static PyObject* _new_ActionOverload(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::AI::Actions::Hosting::ActionOverload>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::AI::Actions::Hosting::ActionOverload>::type_name);
        return nullptr;
    }

    static void _dealloc_ActionOverload(py::wrapper::Windows::AI::Actions::Hosting::ActionOverload* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* ActionOverload_Close(py::wrapper::Windows::AI::Actions::Hosting::ActionOverload* 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.AI.Actions.Hosting.ActionOverload", L"Close", 0);
                }

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

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

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

    static PyObject* ActionOverload_GetInputs(py::wrapper::Windows::AI::Actions::Hosting::ActionOverload* 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.AI.Actions.Hosting.ActionOverload", L"GetInputs", 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.GetInputs();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* ActionOverload_GetSupportsFeedback(py::wrapper::Windows::AI::Actions::Hosting::ActionOverload* 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.AI.Actions.Hosting.ActionOverload", L"GetSupportsFeedback", 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.GetSupportsFeedback();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* ActionOverload_InvokeAsync(py::wrapper::Windows::AI::Actions::Hosting::ActionOverload* 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.AI.Actions.Hosting.ActionOverload", L"InvokeAsync", 1);
                }

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

                auto param0 = py::convert_to<winrt::Windows::AI::Actions::ActionInvocationContext>(args, 0);

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

    static PyObject* ActionOverload_InvokeFeedbackAsync(py::wrapper::Windows::AI::Actions::Hosting::ActionOverload* 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.AI.Actions.Hosting.ActionOverload", L"InvokeFeedbackAsync", 2);
                }

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

                auto param0 = py::convert_to<winrt::Windows::AI::Actions::ActionInvocationContext>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::AI::Actions::ActionFeedback>(args, 1);

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

    static PyObject* ActionOverload_get_DescriptionTemplate(py::wrapper::Windows::AI::Actions::Hosting::ActionOverload* 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.AI.Actions.Hosting.ActionOverload", L"DescriptionTemplate");
            }

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

    static PyObject* _assign_array_ActionOverload(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::AI::Actions::Hosting::ActionOverload>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_ActionOverload(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::AI::Actions::Hosting::ActionOverload>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _enter_ActionOverload(py::wrapper::Windows::AI::Actions::Hosting::ActionOverload* self, PyObject* /*unused*/) noexcept
    {
        return Py_NewRef(self);
    }

    static PyObject* _exit_ActionOverload(py::wrapper::Windows::AI::Actions::Hosting::ActionOverload* self, PyObject* /*unused*/) noexcept
    {
        try
        {
            {
                auto _gil = py::release_gil();
                self->obj.Close();
            }

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

    static PyMethodDef _methods_ActionOverload[] = {
        { "close", reinterpret_cast<PyCFunction>(ActionOverload_Close), METH_VARARGS, nullptr },
        { "get_inputs", reinterpret_cast<PyCFunction>(ActionOverload_GetInputs), METH_VARARGS, nullptr },
        { "get_supports_feedback", reinterpret_cast<PyCFunction>(ActionOverload_GetSupportsFeedback), METH_VARARGS, nullptr },
        { "invoke_async", reinterpret_cast<PyCFunction>(ActionOverload_InvokeAsync), METH_VARARGS, nullptr },
        { "invoke_feedback_async", reinterpret_cast<PyCFunction>(ActionOverload_InvokeFeedbackAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_ActionOverload, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_ActionOverload), METH_O | METH_STATIC, nullptr },
        { "__enter__", reinterpret_cast<PyCFunction>(_enter_ActionOverload), METH_NOARGS, nullptr },
        { "__exit__", reinterpret_cast<PyCFunction>(_exit_ActionOverload), METH_VARARGS, nullptr },
        { }};

    static PyGetSetDef _getset_ActionOverload[] = {
        { "description_template", reinterpret_cast<getter>(ActionOverload_get_DescriptionTemplate), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_ActionOverload[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_ActionOverload) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_ActionOverload) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_ActionOverload) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_ActionOverload) },
        { }};

    static PyType_Spec type_spec_ActionOverload = {
        "winrt._winrt_windows_ai_actions_hosting.ActionOverload",
        sizeof(py::wrapper::Windows::AI::Actions::Hosting::ActionOverload),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_ActionOverload};

    // ----- Windows.AI.Actions.Hosting Initialization --------------------

    PyDoc_STRVAR(module_doc, "Windows.AI.Actions.Hosting");

    static PyModuleDef module_def = {
        PyModuleDef_HEAD_INIT,
        "_winrt_windows_ai_actions_hosting",
        module_doc,
        0,
        nullptr,
        nullptr,
        nullptr,
        nullptr,
        nullptr};
} // py::cpp::Windows::AI::Actions::Hosting

PyMODINIT_FUNC PyInit__winrt_windows_ai_actions_hosting(void) noexcept
{
    using namespace py::cpp::Windows::AI::Actions::Hosting;

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

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

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

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

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

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


    return module.detach();
}
