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

#include "py.Windows.ApplicationModel.Search.Core.h"

namespace py::cpp::Windows::ApplicationModel::Search::Core
{
    // ----- RequestingFocusOnKeyboardInputEventArgs class --------------------

    static PyObject* _new_RequestingFocusOnKeyboardInputEventArgs(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::ApplicationModel::Search::Core::RequestingFocusOnKeyboardInputEventArgs>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::ApplicationModel::Search::Core::RequestingFocusOnKeyboardInputEventArgs>::type_name);
        return nullptr;
    }

    static void _dealloc_RequestingFocusOnKeyboardInputEventArgs(py::wrapper::Windows::ApplicationModel::Search::Core::RequestingFocusOnKeyboardInputEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* _assign_array_RequestingFocusOnKeyboardInputEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::ApplicationModel::Search::Core::RequestingFocusOnKeyboardInputEventArgs>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_RequestingFocusOnKeyboardInputEventArgs(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::ApplicationModel::Search::Core::RequestingFocusOnKeyboardInputEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_RequestingFocusOnKeyboardInputEventArgs[] = {
        { "_assign_array_", _assign_array_RequestingFocusOnKeyboardInputEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_RequestingFocusOnKeyboardInputEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_RequestingFocusOnKeyboardInputEventArgs[] = {
        { }
    };

    static PyType_Slot _type_slots_RequestingFocusOnKeyboardInputEventArgs[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_RequestingFocusOnKeyboardInputEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_RequestingFocusOnKeyboardInputEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_RequestingFocusOnKeyboardInputEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_RequestingFocusOnKeyboardInputEventArgs) },
        { }
    };

    static PyType_Spec type_spec_RequestingFocusOnKeyboardInputEventArgs = {
        "winrt._winrt_windows_applicationmodel_search_core.RequestingFocusOnKeyboardInputEventArgs",
        sizeof(py::wrapper::Windows::ApplicationModel::Search::Core::RequestingFocusOnKeyboardInputEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_RequestingFocusOnKeyboardInputEventArgs};

    // ----- SearchSuggestion class --------------------

    static PyObject* _new_SearchSuggestion(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::ApplicationModel::Search::Core::SearchSuggestion>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::ApplicationModel::Search::Core::SearchSuggestion>::type_name);
        return nullptr;
    }

    static void _dealloc_SearchSuggestion(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestion* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* SearchSuggestion_get_DetailText(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestion* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestion", L"DetailText"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

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

    static PyObject* SearchSuggestion_get_Image(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestion* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestion", L"Image"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

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

    static PyObject* SearchSuggestion_get_ImageAlternateText(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestion* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestion", L"ImageAlternateText"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

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

    static PyObject* SearchSuggestion_get_Kind(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestion* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestion", L"Kind"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

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

    static PyObject* SearchSuggestion_get_Tag(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestion* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestion", L"Tag"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

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

    static PyObject* SearchSuggestion_get_Text(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestion* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestion", L"Text"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

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

    static PyObject* _assign_array_SearchSuggestion(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::ApplicationModel::Search::Core::SearchSuggestion>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_SearchSuggestion(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::ApplicationModel::Search::Core::SearchSuggestion>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SearchSuggestion[] = {
        { "_assign_array_", _assign_array_SearchSuggestion, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SearchSuggestion), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SearchSuggestion[] = {
        { "detail_text", reinterpret_cast<getter>(SearchSuggestion_get_DetailText), nullptr, nullptr, nullptr },
        { "image", reinterpret_cast<getter>(SearchSuggestion_get_Image), nullptr, nullptr, nullptr },
        { "image_alternate_text", reinterpret_cast<getter>(SearchSuggestion_get_ImageAlternateText), nullptr, nullptr, nullptr },
        { "kind", reinterpret_cast<getter>(SearchSuggestion_get_Kind), nullptr, nullptr, nullptr },
        { "tag", reinterpret_cast<getter>(SearchSuggestion_get_Tag), nullptr, nullptr, nullptr },
        { "text", reinterpret_cast<getter>(SearchSuggestion_get_Text), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SearchSuggestion[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_SearchSuggestion) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SearchSuggestion) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SearchSuggestion) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SearchSuggestion) },
        { }
    };

    static PyType_Spec type_spec_SearchSuggestion = {
        "winrt._winrt_windows_applicationmodel_search_core.SearchSuggestion",
        sizeof(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestion),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SearchSuggestion};

    // ----- SearchSuggestionManager class --------------------

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

        auto arg_count = PyTuple_Size(args);
        if (arg_count == 0)
        {
            try
            {
                winrt::Windows::ApplicationModel::Search::Core::SearchSuggestionManager instance{  };
                return py::wrap(instance, type);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static void _dealloc_SearchSuggestionManager(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionManager* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* SearchSuggestionManager_AddToHistory(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionManager* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionManager", L"AddToHistory", 1))
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

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

                self->obj.AddToHistory(param0);
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 2)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionManager", L"AddToHistory", 2))
                {
                    py::set_arg_count_version_error(2);
                    return nullptr;
                }

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

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

    static PyObject* SearchSuggestionManager_ClearHistory(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionManager* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionManager", L"ClearHistory", 0))
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                self->obj.ClearHistory();
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* SearchSuggestionManager_SetLocalContentSuggestionSettings(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionManager* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionManager", L"SetLocalContentSuggestionSettings", 1))
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::ApplicationModel::Search::LocalContentSuggestionSettings>(args, 0);

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

    static PyObject* SearchSuggestionManager_SetQuery(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionManager* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionManager", L"SetQuery", 1))
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

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

                self->obj.SetQuery(param0);
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 2)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionManager", L"SetQuery", 2))
                {
                    py::set_arg_count_version_error(2);
                    return nullptr;
                }

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

                self->obj.SetQuery(param0, param1);
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 3)
        {
            try
            {
                if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionManager", L"SetQuery", 3))
                {
                    py::set_arg_count_version_error(3);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::hstring>(args, 0);
                auto param1 = py::convert_to<winrt::hstring>(args, 1);
                auto param2 = py::convert_to<winrt::Windows::ApplicationModel::Search::SearchQueryLinguisticDetails>(args, 2);

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

    static PyObject* SearchSuggestionManager_get_SearchHistoryEnabled(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionManager* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionManager", L"SearchHistoryEnabled"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

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

    static int SearchSuggestionManager_put_SearchHistoryEnabled(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionManager* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionManager", L"SearchHistoryEnabled"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

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

            self->obj.SearchHistoryEnabled(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* SearchSuggestionManager_get_SearchHistoryContext(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionManager* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionManager", L"SearchHistoryContext"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

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

    static int SearchSuggestionManager_put_SearchHistoryContext(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionManager* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionManager", L"SearchHistoryContext"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

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

            self->obj.SearchHistoryContext(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* SearchSuggestionManager_get_Suggestions(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionManager* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionManager", L"Suggestions"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

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

    static PyObject* SearchSuggestionManager_add_RequestingFocusOnKeyboardInput(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionManager* self, PyObject* arg) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionManager", L"RequestingFocusOnKeyboardInput"))
            {
                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::ApplicationModel::Search::Core::SearchSuggestionManager, winrt::Windows::ApplicationModel::Search::Core::RequestingFocusOnKeyboardInputEventArgs>>(arg);

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

    static PyObject* SearchSuggestionManager_remove_RequestingFocusOnKeyboardInput(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionManager* self, PyObject* arg) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionManager", L"RequestingFocusOnKeyboardInput"))
            {
                PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
                return nullptr;
            }

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

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

    static PyObject* SearchSuggestionManager_add_SuggestionsRequested(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionManager* self, PyObject* arg) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionManager", L"SuggestionsRequested"))
            {
                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::ApplicationModel::Search::Core::SearchSuggestionManager, winrt::Windows::ApplicationModel::Search::Core::SearchSuggestionsRequestedEventArgs>>(arg);

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

    static PyObject* SearchSuggestionManager_remove_SuggestionsRequested(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionManager* self, PyObject* arg) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionManager", L"SuggestionsRequested"))
            {
                PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
                return nullptr;
            }

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

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

    static PyObject* _assign_array_SearchSuggestionManager(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::ApplicationModel::Search::Core::SearchSuggestionManager>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_SearchSuggestionManager(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::ApplicationModel::Search::Core::SearchSuggestionManager>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SearchSuggestionManager[] = {
        { "add_to_history", reinterpret_cast<PyCFunction>(SearchSuggestionManager_AddToHistory), METH_VARARGS, nullptr },
        { "clear_history", reinterpret_cast<PyCFunction>(SearchSuggestionManager_ClearHistory), METH_VARARGS, nullptr },
        { "set_local_content_suggestion_settings", reinterpret_cast<PyCFunction>(SearchSuggestionManager_SetLocalContentSuggestionSettings), METH_VARARGS, nullptr },
        { "set_query", reinterpret_cast<PyCFunction>(SearchSuggestionManager_SetQuery), METH_VARARGS, nullptr },
        { "add_requesting_focus_on_keyboard_input", reinterpret_cast<PyCFunction>(SearchSuggestionManager_add_RequestingFocusOnKeyboardInput), METH_O, nullptr },
        { "remove_requesting_focus_on_keyboard_input", reinterpret_cast<PyCFunction>(SearchSuggestionManager_remove_RequestingFocusOnKeyboardInput), METH_O, nullptr },
        { "add_suggestions_requested", reinterpret_cast<PyCFunction>(SearchSuggestionManager_add_SuggestionsRequested), METH_O, nullptr },
        { "remove_suggestions_requested", reinterpret_cast<PyCFunction>(SearchSuggestionManager_remove_SuggestionsRequested), METH_O, nullptr },
        { "_assign_array_", _assign_array_SearchSuggestionManager, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SearchSuggestionManager), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SearchSuggestionManager[] = {
        { "search_history_enabled", reinterpret_cast<getter>(SearchSuggestionManager_get_SearchHistoryEnabled), reinterpret_cast<setter>(SearchSuggestionManager_put_SearchHistoryEnabled), nullptr, nullptr },
        { "search_history_context", reinterpret_cast<getter>(SearchSuggestionManager_get_SearchHistoryContext), reinterpret_cast<setter>(SearchSuggestionManager_put_SearchHistoryContext), nullptr, nullptr },
        { "suggestions", reinterpret_cast<getter>(SearchSuggestionManager_get_Suggestions), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SearchSuggestionManager[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_SearchSuggestionManager) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SearchSuggestionManager) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SearchSuggestionManager) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SearchSuggestionManager) },
        { }
    };

    static PyType_Spec type_spec_SearchSuggestionManager = {
        "winrt._winrt_windows_applicationmodel_search_core.SearchSuggestionManager",
        sizeof(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionManager),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SearchSuggestionManager};

    // ----- SearchSuggestionsRequestedEventArgs class --------------------

    static PyObject* _new_SearchSuggestionsRequestedEventArgs(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::ApplicationModel::Search::Core::SearchSuggestionsRequestedEventArgs>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::ApplicationModel::Search::Core::SearchSuggestionsRequestedEventArgs>::type_name);
        return nullptr;
    }

    static void _dealloc_SearchSuggestionsRequestedEventArgs(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionsRequestedEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* SearchSuggestionsRequestedEventArgs_get_Language(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionsRequestedEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionsRequestedEventArgs", L"Language"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

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

    static PyObject* SearchSuggestionsRequestedEventArgs_get_LinguisticDetails(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionsRequestedEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionsRequestedEventArgs", L"LinguisticDetails"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

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

    static PyObject* SearchSuggestionsRequestedEventArgs_get_QueryText(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionsRequestedEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionsRequestedEventArgs", L"QueryText"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

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

    static PyObject* SearchSuggestionsRequestedEventArgs_get_Request(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionsRequestedEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.Search.Core.SearchSuggestionsRequestedEventArgs", L"Request"))
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

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

    static PyObject* _assign_array_SearchSuggestionsRequestedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::ApplicationModel::Search::Core::SearchSuggestionsRequestedEventArgs>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_SearchSuggestionsRequestedEventArgs(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::ApplicationModel::Search::Core::SearchSuggestionsRequestedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SearchSuggestionsRequestedEventArgs[] = {
        { "_assign_array_", _assign_array_SearchSuggestionsRequestedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SearchSuggestionsRequestedEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SearchSuggestionsRequestedEventArgs[] = {
        { "language", reinterpret_cast<getter>(SearchSuggestionsRequestedEventArgs_get_Language), nullptr, nullptr, nullptr },
        { "linguistic_details", reinterpret_cast<getter>(SearchSuggestionsRequestedEventArgs_get_LinguisticDetails), nullptr, nullptr, nullptr },
        { "query_text", reinterpret_cast<getter>(SearchSuggestionsRequestedEventArgs_get_QueryText), nullptr, nullptr, nullptr },
        { "request", reinterpret_cast<getter>(SearchSuggestionsRequestedEventArgs_get_Request), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SearchSuggestionsRequestedEventArgs[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_SearchSuggestionsRequestedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SearchSuggestionsRequestedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SearchSuggestionsRequestedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SearchSuggestionsRequestedEventArgs) },
        { }
    };

    static PyType_Spec type_spec_SearchSuggestionsRequestedEventArgs = {
        "winrt._winrt_windows_applicationmodel_search_core.SearchSuggestionsRequestedEventArgs",
        sizeof(py::wrapper::Windows::ApplicationModel::Search::Core::SearchSuggestionsRequestedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SearchSuggestionsRequestedEventArgs};

    // ----- Windows.ApplicationModel.Search.Core Initialization --------------------

    PyDoc_STRVAR(module_doc, "Windows.ApplicationModel.Search.Core");

    static PyModuleDef module_def = {
        PyModuleDef_HEAD_INIT,
        "_winrt_windows_applicationmodel_search_core",
        module_doc,
        0,
        nullptr,
        nullptr,
        nullptr,
        nullptr,
        nullptr};
} // py::cpp::Windows::ApplicationModel::Search::Core

PyMODINIT_FUNC PyInit__winrt_windows_applicationmodel_search_core(void) noexcept
{
    using namespace py::cpp::Windows::ApplicationModel::Search::Core;

    if (py::import_winrt_runtime() == -1)
    {
        return nullptr;
    }

    py::pyobj_handle module{PyModule_Create(&module_def)};

    if (!module)
    {
        return nullptr;
    }

    auto object_type = py::get_object_type();
    if (!object_type)
    {
        return nullptr;
    }

    py::pyobj_handle object_bases{PyTuple_Pack(1, object_type)};

    if (!object_bases)
    {
        return nullptr;
    }

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

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

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

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


    return module.detach();
}
