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

#include "py.Windows.Storage.Search.h"

namespace py::cpp::Windows::Storage::Search
{
    // ----- ContentIndexer class --------------------

    static PyObject* _new_ContentIndexer(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Storage::Search::ContentIndexer>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Storage::Search::ContentIndexer>::type_name);
        return nullptr;
    }

    static void _dealloc_ContentIndexer(py::wrapper::Windows::Storage::Search::ContentIndexer* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* ContentIndexer_AddAsync(py::wrapper::Windows::Storage::Search::ContentIndexer* 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.Storage.Search.ContentIndexer", L"AddAsync", 1);
                }

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

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

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

    static PyObject* ContentIndexer_CreateQuery(py::wrapper::Windows::Storage::Search::ContentIndexer* 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.Storage.Search.ContentIndexer", L"CreateQuery", 2);
                }

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

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

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

    static PyObject* ContentIndexer_CreateQueryWithSortOrder(py::wrapper::Windows::Storage::Search::ContentIndexer* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 3)
        {
            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.Storage.Search.ContentIndexer", L"CreateQuery", 3);
                }

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

                auto param0 = py::convert_to<winrt::hstring>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::Collections::IIterable<winrt::hstring>>(args, 1);
                auto param2 = py::convert_to<winrt::Windows::Foundation::Collections::IIterable<winrt::Windows::Storage::Search::SortEntry>>(args, 2);

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

    static PyObject* ContentIndexer_CreateQueryWithSortOrderAndLanguage(py::wrapper::Windows::Storage::Search::ContentIndexer* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 4)
        {
            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.Storage.Search.ContentIndexer", L"CreateQuery", 4);
                }

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

                auto param0 = py::convert_to<winrt::hstring>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::Collections::IIterable<winrt::hstring>>(args, 1);
                auto param2 = py::convert_to<winrt::Windows::Foundation::Collections::IIterable<winrt::Windows::Storage::Search::SortEntry>>(args, 2);
                auto param3 = py::convert_to<winrt::hstring>(args, 3);

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

    static PyObject* ContentIndexer_DeleteAllAsync(py::wrapper::Windows::Storage::Search::ContentIndexer* 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.Storage.Search.ContentIndexer", L"DeleteAllAsync", 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.DeleteAllAsync();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* ContentIndexer_DeleteAsync(py::wrapper::Windows::Storage::Search::ContentIndexer* 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.Storage.Search.ContentIndexer", L"DeleteAsync", 1);
                }

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

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

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

    static PyObject* ContentIndexer_DeleteMultipleAsync(py::wrapper::Windows::Storage::Search::ContentIndexer* 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.Storage.Search.ContentIndexer", L"DeleteMultipleAsync", 1);
                }

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

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

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

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

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

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Storage.Search.ContentIndexer", L"GetIndexer", 0);
                }

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

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return winrt::Windows::Storage::Search::ContentIndexer::GetIndexer();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

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

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Storage.Search.ContentIndexer", L"GetIndexer", 1);
                }

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

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

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return winrt::Windows::Storage::Search::ContentIndexer::GetIndexer(param0);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* ContentIndexer_RetrievePropertiesAsync(py::wrapper::Windows::Storage::Search::ContentIndexer* 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.Storage.Search.ContentIndexer", L"RetrievePropertiesAsync", 2);
                }

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

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

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

    static PyObject* ContentIndexer_UpdateAsync(py::wrapper::Windows::Storage::Search::ContentIndexer* 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.Storage.Search.ContentIndexer", L"UpdateAsync", 1);
                }

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

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

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

    static PyObject* ContentIndexer_get_Revision(py::wrapper::Windows::Storage::Search::ContentIndexer* 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.Storage.Search.ContentIndexer", L"Revision");
            }

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

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

    static PyObject* _from_ContentIndexer(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::Storage::Search::ContentIndexer>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_ContentIndexer[] = {
        { "add_async", reinterpret_cast<PyCFunction>(ContentIndexer_AddAsync), METH_VARARGS, nullptr },
        { "create_query", reinterpret_cast<PyCFunction>(ContentIndexer_CreateQuery), METH_VARARGS, nullptr },
        { "create_query_with_sort_order", reinterpret_cast<PyCFunction>(ContentIndexer_CreateQueryWithSortOrder), METH_VARARGS, nullptr },
        { "create_query_with_sort_order_and_language", reinterpret_cast<PyCFunction>(ContentIndexer_CreateQueryWithSortOrderAndLanguage), METH_VARARGS, nullptr },
        { "delete_all_async", reinterpret_cast<PyCFunction>(ContentIndexer_DeleteAllAsync), METH_VARARGS, nullptr },
        { "delete_async", reinterpret_cast<PyCFunction>(ContentIndexer_DeleteAsync), METH_VARARGS, nullptr },
        { "delete_multiple_async", reinterpret_cast<PyCFunction>(ContentIndexer_DeleteMultipleAsync), METH_VARARGS, nullptr },
        { "retrieve_properties_async", reinterpret_cast<PyCFunction>(ContentIndexer_RetrievePropertiesAsync), METH_VARARGS, nullptr },
        { "update_async", reinterpret_cast<PyCFunction>(ContentIndexer_UpdateAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_ContentIndexer, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_ContentIndexer), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_ContentIndexer[] = {
        { "revision", reinterpret_cast<getter>(ContentIndexer_get_Revision), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_ContentIndexer[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_ContentIndexer) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_ContentIndexer) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_ContentIndexer) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_ContentIndexer) },
        { }};

    static PyType_Spec type_spec_ContentIndexer = {
        "winrt._winrt_windows_storage_search.ContentIndexer",
        sizeof(py::wrapper::Windows::Storage::Search::ContentIndexer),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_ContentIndexer};

    static PyGetSetDef getset_ContentIndexer_Static[] = {
        { }};

    static PyMethodDef methods_ContentIndexer_Static[] = {
        { "get_indexer", reinterpret_cast<PyCFunction>(ContentIndexer_GetIndexer), METH_VARARGS, nullptr },
        { "get_indexer_with_name", reinterpret_cast<PyCFunction>(ContentIndexer_GetIndexerWithName), METH_VARARGS, nullptr },
        { }};

    static PyType_Slot type_slots_ContentIndexer_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_ContentIndexer_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_ContentIndexer_Static) },
        { }
    };

    static PyType_Spec type_spec_ContentIndexer_Static = {
        "winrt._winrt_windows_storage_search.ContentIndexer_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_ContentIndexer_Static};

    // ----- ContentIndexerQuery class --------------------

    static PyObject* _new_ContentIndexerQuery(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Storage::Search::ContentIndexerQuery>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Storage::Search::ContentIndexerQuery>::type_name);
        return nullptr;
    }

    static void _dealloc_ContentIndexerQuery(py::wrapper::Windows::Storage::Search::ContentIndexerQuery* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* ContentIndexerQuery_GetAsync(py::wrapper::Windows::Storage::Search::ContentIndexerQuery* 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.Storage.Search.ContentIndexerQuery", L"GetAsync", 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.GetAsync();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* ContentIndexerQuery_GetCountAsync(py::wrapper::Windows::Storage::Search::ContentIndexerQuery* 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.Storage.Search.ContentIndexerQuery", L"GetCountAsync", 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.GetCountAsync();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* ContentIndexerQuery_GetPropertiesAsync(py::wrapper::Windows::Storage::Search::ContentIndexerQuery* 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.Storage.Search.ContentIndexerQuery", L"GetPropertiesAsync", 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.GetPropertiesAsync();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* ContentIndexerQuery_GetPropertiesRangeAsync(py::wrapper::Windows::Storage::Search::ContentIndexerQuery* 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.Storage.Search.ContentIndexerQuery", L"GetPropertiesAsync", 2);
                }

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

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

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

    static PyObject* ContentIndexerQuery_GetRangeAsync(py::wrapper::Windows::Storage::Search::ContentIndexerQuery* 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.Storage.Search.ContentIndexerQuery", L"GetAsync", 2);
                }

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

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

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

    static PyObject* ContentIndexerQuery_get_QueryFolder(py::wrapper::Windows::Storage::Search::ContentIndexerQuery* 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.Storage.Search.ContentIndexerQuery", L"QueryFolder");
            }

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

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

    static PyObject* _from_ContentIndexerQuery(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::Storage::Search::ContentIndexerQuery>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_ContentIndexerQuery[] = {
        { "get_async", reinterpret_cast<PyCFunction>(ContentIndexerQuery_GetAsync), METH_VARARGS, nullptr },
        { "get_count_async", reinterpret_cast<PyCFunction>(ContentIndexerQuery_GetCountAsync), METH_VARARGS, nullptr },
        { "get_properties_async", reinterpret_cast<PyCFunction>(ContentIndexerQuery_GetPropertiesAsync), METH_VARARGS, nullptr },
        { "get_properties_range_async", reinterpret_cast<PyCFunction>(ContentIndexerQuery_GetPropertiesRangeAsync), METH_VARARGS, nullptr },
        { "get_range_async", reinterpret_cast<PyCFunction>(ContentIndexerQuery_GetRangeAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_ContentIndexerQuery, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_ContentIndexerQuery), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_ContentIndexerQuery[] = {
        { "query_folder", reinterpret_cast<getter>(ContentIndexerQuery_get_QueryFolder), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_ContentIndexerQuery[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_ContentIndexerQuery) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_ContentIndexerQuery) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_ContentIndexerQuery) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_ContentIndexerQuery) },
        { }};

    static PyType_Spec type_spec_ContentIndexerQuery = {
        "winrt._winrt_windows_storage_search.ContentIndexerQuery",
        sizeof(py::wrapper::Windows::Storage::Search::ContentIndexerQuery),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_ContentIndexerQuery};

    // ----- IndexableContent class --------------------

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

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

    static PyObject* IndexableContent_get_StreamContentType(py::wrapper::Windows::Storage::Search::IndexableContent* 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.Storage.Search.IndexableContent", L"StreamContentType");
            }

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

    static int IndexableContent_put_StreamContentType(py::wrapper::Windows::Storage::Search::IndexableContent* 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.Storage.Search.IndexableContent", L"StreamContentType");
            }

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

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

    static PyObject* IndexableContent_get_Stream(py::wrapper::Windows::Storage::Search::IndexableContent* 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.Storage.Search.IndexableContent", L"Stream");
            }

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

    static int IndexableContent_put_Stream(py::wrapper::Windows::Storage::Search::IndexableContent* 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.Storage.Search.IndexableContent", L"Stream");
            }

            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::Storage::Streams::IRandomAccessStream>(arg);

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

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

    static PyObject* IndexableContent_get_Id(py::wrapper::Windows::Storage::Search::IndexableContent* 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.Storage.Search.IndexableContent", 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 int IndexableContent_put_Id(py::wrapper::Windows::Storage::Search::IndexableContent* 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.Storage.Search.IndexableContent", L"Id");
            }

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

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

    static PyObject* IndexableContent_get_Properties(py::wrapper::Windows::Storage::Search::IndexableContent* 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.Storage.Search.IndexableContent", L"Properties");
            }

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

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

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

    static PyObject* _from_IndexableContent(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::Storage::Search::IndexableContent>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_IndexableContent[] = {
        { "_assign_array_", _assign_array_IndexableContent, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_IndexableContent), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_IndexableContent[] = {
        { "stream_content_type", reinterpret_cast<getter>(IndexableContent_get_StreamContentType), reinterpret_cast<setter>(IndexableContent_put_StreamContentType), nullptr, nullptr },
        { "stream", reinterpret_cast<getter>(IndexableContent_get_Stream), reinterpret_cast<setter>(IndexableContent_put_Stream), nullptr, nullptr },
        { "id", reinterpret_cast<getter>(IndexableContent_get_Id), reinterpret_cast<setter>(IndexableContent_put_Id), nullptr, nullptr },
        { "properties", reinterpret_cast<getter>(IndexableContent_get_Properties), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_IndexableContent[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_IndexableContent) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IndexableContent) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IndexableContent) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IndexableContent) },
        { }};

    static PyType_Spec type_spec_IndexableContent = {
        "winrt._winrt_windows_storage_search.IndexableContent",
        sizeof(py::wrapper::Windows::Storage::Search::IndexableContent),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_IndexableContent};

    // ----- QueryOptions class --------------------

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

        auto arg_count = PyTuple_GET_SIZE(args);
        if (arg_count == 2)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Storage::Search::CommonFileQuery>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::Collections::IIterable<winrt::hstring>>(args, 1);

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

                winrt::Windows::Storage::Search::QueryOptions instance{param0};
                return py::wrap(instance, type);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 0)
        {
            try
            {
                winrt::Windows::Storage::Search::QueryOptions 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_QueryOptions(py::wrapper::Windows::Storage::Search::QueryOptions* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* QueryOptions_LoadFromString(py::wrapper::Windows::Storage::Search::QueryOptions* 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.Storage.Search.QueryOptions", L"LoadFromString", 1);
                }

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

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

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

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

    static PyObject* QueryOptions_SaveToString(py::wrapper::Windows::Storage::Search::QueryOptions* 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.Storage.Search.QueryOptions", L"SaveToString", 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.SaveToString();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* QueryOptions_SetPropertyPrefetch(py::wrapper::Windows::Storage::Search::QueryOptions* 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.Storage.Search.QueryOptions", L"SetPropertyPrefetch", 2);
                }

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

                auto param0 = py::convert_to<winrt::Windows::Storage::FileProperties::PropertyPrefetchOptions>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::Collections::IIterable<winrt::hstring>>(args, 1);

                {
                    auto _gil = release_gil();
                    self->obj.SetPropertyPrefetch(param0, param1);
                }

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

    static PyObject* QueryOptions_SetThumbnailPrefetch(py::wrapper::Windows::Storage::Search::QueryOptions* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 3)
        {
            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.Storage.Search.QueryOptions", L"SetThumbnailPrefetch", 3);
                }

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

                auto param0 = py::convert_to<winrt::Windows::Storage::FileProperties::ThumbnailMode>(args, 0);
                auto param1 = py::convert_to<uint32_t>(args, 1);
                auto param2 = py::convert_to<winrt::Windows::Storage::FileProperties::ThumbnailOptions>(args, 2);

                {
                    auto _gil = release_gil();
                    self->obj.SetThumbnailPrefetch(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* QueryOptions_get_UserSearchFilter(py::wrapper::Windows::Storage::Search::QueryOptions* 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.Storage.Search.QueryOptions", L"UserSearchFilter");
            }

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

    static int QueryOptions_put_UserSearchFilter(py::wrapper::Windows::Storage::Search::QueryOptions* 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.Storage.Search.QueryOptions", L"UserSearchFilter");
            }

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

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

    static PyObject* QueryOptions_get_Language(py::wrapper::Windows::Storage::Search::QueryOptions* 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.Storage.Search.QueryOptions", L"Language");
            }

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

    static int QueryOptions_put_Language(py::wrapper::Windows::Storage::Search::QueryOptions* 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.Storage.Search.QueryOptions", L"Language");
            }

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

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

    static PyObject* QueryOptions_get_IndexerOption(py::wrapper::Windows::Storage::Search::QueryOptions* 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.Storage.Search.QueryOptions", L"IndexerOption");
            }

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

    static int QueryOptions_put_IndexerOption(py::wrapper::Windows::Storage::Search::QueryOptions* 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.Storage.Search.QueryOptions", L"IndexerOption");
            }

            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::Storage::Search::IndexerOption>(arg);

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

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

    static PyObject* QueryOptions_get_FolderDepth(py::wrapper::Windows::Storage::Search::QueryOptions* 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.Storage.Search.QueryOptions", L"FolderDepth");
            }

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

    static int QueryOptions_put_FolderDepth(py::wrapper::Windows::Storage::Search::QueryOptions* 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.Storage.Search.QueryOptions", L"FolderDepth");
            }

            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::Storage::Search::FolderDepth>(arg);

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

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

    static PyObject* QueryOptions_get_ApplicationSearchFilter(py::wrapper::Windows::Storage::Search::QueryOptions* 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.Storage.Search.QueryOptions", L"ApplicationSearchFilter");
            }

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

    static int QueryOptions_put_ApplicationSearchFilter(py::wrapper::Windows::Storage::Search::QueryOptions* 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.Storage.Search.QueryOptions", L"ApplicationSearchFilter");
            }

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

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

    static PyObject* QueryOptions_get_DateStackOption(py::wrapper::Windows::Storage::Search::QueryOptions* 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.Storage.Search.QueryOptions", L"DateStackOption");
            }

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

    static PyObject* QueryOptions_get_FileTypeFilter(py::wrapper::Windows::Storage::Search::QueryOptions* 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.Storage.Search.QueryOptions", L"FileTypeFilter");
            }

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

    static PyObject* QueryOptions_get_GroupPropertyName(py::wrapper::Windows::Storage::Search::QueryOptions* 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.Storage.Search.QueryOptions", L"GroupPropertyName");
            }

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

    static PyObject* QueryOptions_get_SortOrder(py::wrapper::Windows::Storage::Search::QueryOptions* 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.Storage.Search.QueryOptions", L"SortOrder");
            }

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

    static PyObject* QueryOptions_get_StorageProviderIdFilter(py::wrapper::Windows::Storage::Search::QueryOptions* 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.Storage.Search.QueryOptions", L"StorageProviderIdFilter");
            }

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

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

    static PyObject* _from_QueryOptions(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::Storage::Search::QueryOptions>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_QueryOptions[] = {
        { "load_from_string", reinterpret_cast<PyCFunction>(QueryOptions_LoadFromString), METH_VARARGS, nullptr },
        { "save_to_string", reinterpret_cast<PyCFunction>(QueryOptions_SaveToString), METH_VARARGS, nullptr },
        { "set_property_prefetch", reinterpret_cast<PyCFunction>(QueryOptions_SetPropertyPrefetch), METH_VARARGS, nullptr },
        { "set_thumbnail_prefetch", reinterpret_cast<PyCFunction>(QueryOptions_SetThumbnailPrefetch), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_QueryOptions, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_QueryOptions), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_QueryOptions[] = {
        { "user_search_filter", reinterpret_cast<getter>(QueryOptions_get_UserSearchFilter), reinterpret_cast<setter>(QueryOptions_put_UserSearchFilter), nullptr, nullptr },
        { "language", reinterpret_cast<getter>(QueryOptions_get_Language), reinterpret_cast<setter>(QueryOptions_put_Language), nullptr, nullptr },
        { "indexer_option", reinterpret_cast<getter>(QueryOptions_get_IndexerOption), reinterpret_cast<setter>(QueryOptions_put_IndexerOption), nullptr, nullptr },
        { "folder_depth", reinterpret_cast<getter>(QueryOptions_get_FolderDepth), reinterpret_cast<setter>(QueryOptions_put_FolderDepth), nullptr, nullptr },
        { "application_search_filter", reinterpret_cast<getter>(QueryOptions_get_ApplicationSearchFilter), reinterpret_cast<setter>(QueryOptions_put_ApplicationSearchFilter), nullptr, nullptr },
        { "date_stack_option", reinterpret_cast<getter>(QueryOptions_get_DateStackOption), nullptr, nullptr, nullptr },
        { "file_type_filter", reinterpret_cast<getter>(QueryOptions_get_FileTypeFilter), nullptr, nullptr, nullptr },
        { "group_property_name", reinterpret_cast<getter>(QueryOptions_get_GroupPropertyName), nullptr, nullptr, nullptr },
        { "sort_order", reinterpret_cast<getter>(QueryOptions_get_SortOrder), nullptr, nullptr, nullptr },
        { "storage_provider_id_filter", reinterpret_cast<getter>(QueryOptions_get_StorageProviderIdFilter), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_QueryOptions[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_QueryOptions) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_QueryOptions) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_QueryOptions) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_QueryOptions) },
        { }};

    static PyType_Spec type_spec_QueryOptions = {
        "winrt._winrt_windows_storage_search.QueryOptions",
        sizeof(py::wrapper::Windows::Storage::Search::QueryOptions),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_QueryOptions};

    // ----- SortEntryVector class --------------------

    static PyObject* _new_SortEntryVector(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Storage::Search::SortEntryVector>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Storage::Search::SortEntryVector>::type_name);
        return nullptr;
    }

    static void _dealloc_SortEntryVector(py::wrapper::Windows::Storage::Search::SortEntryVector* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* SortEntryVector_Append(py::wrapper::Windows::Storage::Search::SortEntryVector* 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.Storage.Search.SortEntryVector", L"Append", 1);
                }

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

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

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

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

    static PyObject* SortEntryVector_Clear(py::wrapper::Windows::Storage::Search::SortEntryVector* 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.Storage.Search.SortEntryVector", L"Clear", 0);
                }

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

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

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

    static PyObject* SortEntryVector_First(py::wrapper::Windows::Storage::Search::SortEntryVector* 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.Storage.Search.SortEntryVector", L"First", 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.First();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* SortEntryVector_GetAt(py::wrapper::Windows::Storage::Search::SortEntryVector* 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.Storage.Search.SortEntryVector", L"GetAt", 1);
                }

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

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

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

    static PyObject* SortEntryVector_GetMany(py::wrapper::Windows::Storage::Search::SortEntryVector* 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.Storage.Search.SortEntryVector", L"GetMany", 1);
                }

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

                auto param0 = py::convert_to<uint32_t>(args, 0);
                auto param1 = py::convert_to<py::pybuf_view<winrt::Windows::Storage::Search::SortEntry, true>>(args, 1);

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

    static PyObject* SortEntryVector_GetView(py::wrapper::Windows::Storage::Search::SortEntryVector* 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.Storage.Search.SortEntryVector", L"GetView", 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.GetView();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* SortEntryVector_IndexOf(py::wrapper::Windows::Storage::Search::SortEntryVector* 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.Storage.Search.SortEntryVector", L"IndexOf", 1);
                }

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

                auto param0 = py::convert_to<winrt::Windows::Storage::Search::SortEntry>(args, 0);
                uint32_t param1{};

                auto return_value = [&]()
                {
                    auto _gil = release_gil();
                    return self->obj.IndexOf(param0, param1);
                }();

                py::pyobj_handle out_return_value{ py::convert(return_value) };
                if (!out_return_value)
                {
                    return nullptr;
                }
                py::pyobj_handle out1{ py::convert(param1) };
                if (!out1)
                {
                    return nullptr;
                }

                return PyTuple_Pack(2, out_return_value.get(), out1.get());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* SortEntryVector_InsertAt(py::wrapper::Windows::Storage::Search::SortEntryVector* 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.Storage.Search.SortEntryVector", L"InsertAt", 2);
                }

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

                auto param0 = py::convert_to<uint32_t>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Storage::Search::SortEntry>(args, 1);

                {
                    auto _gil = release_gil();
                    self->obj.InsertAt(param0, param1);
                }

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

    static PyObject* SortEntryVector_RemoveAt(py::wrapper::Windows::Storage::Search::SortEntryVector* 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.Storage.Search.SortEntryVector", L"RemoveAt", 1);
                }

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

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

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

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

    static PyObject* SortEntryVector_RemoveAtEnd(py::wrapper::Windows::Storage::Search::SortEntryVector* 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.Storage.Search.SortEntryVector", L"RemoveAtEnd", 0);
                }

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

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

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

    static PyObject* SortEntryVector_ReplaceAll(py::wrapper::Windows::Storage::Search::SortEntryVector* 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.Storage.Search.SortEntryVector", L"ReplaceAll", 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::Storage::Search::SortEntry, false>>(args, 0);

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

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

    static PyObject* SortEntryVector_SetAt(py::wrapper::Windows::Storage::Search::SortEntryVector* 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.Storage.Search.SortEntryVector", L"SetAt", 2);
                }

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

                auto param0 = py::convert_to<uint32_t>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Storage::Search::SortEntry>(args, 1);

                {
                    auto _gil = release_gil();
                    self->obj.SetAt(param0, param1);
                }

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

    static PyObject* SortEntryVector_get_Size(py::wrapper::Windows::Storage::Search::SortEntryVector* 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.Storage.Search.SortEntryVector", L"Size");
            }

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

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

    static PyObject* _from_SortEntryVector(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::Storage::Search::SortEntryVector>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _iterator_SortEntryVector(py::wrapper::Windows::Storage::Search::SortEntryVector* self) noexcept
    {
        try
        {
            return py::convert([&]()
            {
                auto _gil = py::release_gil();
                return self->obj.First();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static Py_ssize_t _seq_length_SortEntryVector(py::wrapper::Windows::Storage::Search::SortEntryVector* self) noexcept
    {
        try
        {
            auto _gil = py::release_gil();
            return static_cast<Py_ssize_t>(self->obj.Size());
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* _seq_item_SortEntryVector(py::wrapper::Windows::Storage::Search::SortEntryVector* self, Py_ssize_t i) noexcept
    {
        try
        {
            return py::convert([&]()
            {
                auto _gil = py::release_gil();
                return self->obj.GetAt(static_cast<uint32_t>(i));
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _seq_subscript_SortEntryVector(py::wrapper::Windows::Storage::Search::SortEntryVector* self, PyObject* slice) noexcept
    {
        try
        {
            if (PyIndex_Check(slice))
            {
                pyobj_handle index{PyNumber_Index(slice)};

                if (!index)
                {
                    return nullptr;
                }

                auto i = PyNumber_AsSsize_t(index.get(), PyExc_IndexError);

                if (i == -1 && PyErr_Occurred())
                {
                    return nullptr;
                }

                return _seq_item_SortEntryVector(self, i);
            }

            if (!PySlice_Check(slice))
            {
                PyErr_Format(PyExc_TypeError, "indices must be integers, not '%s'", Py_TYPE(slice)->tp_name);
            }

            Py_ssize_t start, stop, step, length;

            auto size = [&]()
            {
                auto _gil = py::release_gil();
                return self->obj.Size();
            }();
            if (PySlice_GetIndicesEx(slice, size, &start, &stop, &step, &length) < 0)
            {
                return nullptr;
            }

            if (step != 1)
            {
                PyErr_SetString(PyExc_NotImplementedError, "slices with step other than 1 are not implemented");
                return nullptr;
            }

            winrt::com_array<winrt::Windows::Storage::Search::SortEntry> items(static_cast<uint32_t>(length), empty_instance<winrt::Windows::Storage::Search::SortEntry>::get());

            auto count = [&]()
            {
                auto _gil = py::release_gil();
                return self->obj.GetMany(static_cast<uint32_t>(start), items);
            }();

            if (count != static_cast<uint32_t>(length))
            {
                PyErr_Format(PyExc_RuntimeError, "returned count %d did not match requested length %zd", count, length);
                return nullptr;
            }

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

    static int _seq_assign_SortEntryVector(py::wrapper::Windows::Storage::Search::SortEntryVector* self, Py_ssize_t i, PyObject* value) noexcept
    {
        try
        {
            if (!value)
            {
                auto _gil = py::release_gil();
                self->obj.RemoveAt(static_cast<uint32_t>(i));
            }
            else
            {
                auto _value = py::convert_to<winrt::Windows::Storage::Search::SortEntry>(value);
                {
                    auto _gil = py::release_gil();
                    self->obj.SetAt(static_cast<uint32_t>(i), _value);
                }
            }

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

    static PyMethodDef _methods_SortEntryVector[] = {
        { "append", reinterpret_cast<PyCFunction>(SortEntryVector_Append), METH_VARARGS, nullptr },
        { "clear", reinterpret_cast<PyCFunction>(SortEntryVector_Clear), METH_VARARGS, nullptr },
        { "first", reinterpret_cast<PyCFunction>(SortEntryVector_First), METH_VARARGS, nullptr },
        { "get_at", reinterpret_cast<PyCFunction>(SortEntryVector_GetAt), METH_VARARGS, nullptr },
        { "get_many", reinterpret_cast<PyCFunction>(SortEntryVector_GetMany), METH_VARARGS, nullptr },
        { "get_view", reinterpret_cast<PyCFunction>(SortEntryVector_GetView), METH_VARARGS, nullptr },
        { "index_of", reinterpret_cast<PyCFunction>(SortEntryVector_IndexOf), METH_VARARGS, nullptr },
        { "insert_at", reinterpret_cast<PyCFunction>(SortEntryVector_InsertAt), METH_VARARGS, nullptr },
        { "remove_at", reinterpret_cast<PyCFunction>(SortEntryVector_RemoveAt), METH_VARARGS, nullptr },
        { "remove_at_end", reinterpret_cast<PyCFunction>(SortEntryVector_RemoveAtEnd), METH_VARARGS, nullptr },
        { "replace_all", reinterpret_cast<PyCFunction>(SortEntryVector_ReplaceAll), METH_VARARGS, nullptr },
        { "set_at", reinterpret_cast<PyCFunction>(SortEntryVector_SetAt), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_SortEntryVector, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SortEntryVector), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_SortEntryVector[] = {
        { "size", reinterpret_cast<getter>(SortEntryVector_get_Size), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_SortEntryVector[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_SortEntryVector) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SortEntryVector) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SortEntryVector) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SortEntryVector) },
        { Py_tp_iter, reinterpret_cast<void*>(_iterator_SortEntryVector) },
        { Py_sq_length, reinterpret_cast<void*>(_seq_length_SortEntryVector) },
        { Py_sq_item, reinterpret_cast<void*>(_seq_item_SortEntryVector) },
        { Py_mp_subscript, reinterpret_cast<void*>(_seq_subscript_SortEntryVector) },
        { Py_sq_ass_item, reinterpret_cast<void*>(_seq_assign_SortEntryVector) },
        { }};

    static PyType_Spec type_spec_SortEntryVector = {
        "winrt._winrt_windows_storage_search.SortEntryVector",
        sizeof(py::wrapper::Windows::Storage::Search::SortEntryVector),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SortEntryVector};

    // ----- StorageFileQueryResult class --------------------

    static PyObject* _new_StorageFileQueryResult(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Storage::Search::StorageFileQueryResult>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Storage::Search::StorageFileQueryResult>::type_name);
        return nullptr;
    }

    static void _dealloc_StorageFileQueryResult(py::wrapper::Windows::Storage::Search::StorageFileQueryResult* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* StorageFileQueryResult_ApplyNewQueryOptions(py::wrapper::Windows::Storage::Search::StorageFileQueryResult* 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.Storage.Search.StorageFileQueryResult", L"ApplyNewQueryOptions", 1);
                }

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

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

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

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

    static PyObject* StorageFileQueryResult_FindStartIndexAsync(py::wrapper::Windows::Storage::Search::StorageFileQueryResult* 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.Storage.Search.StorageFileQueryResult", L"FindStartIndexAsync", 1);
                }

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

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

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

    static PyObject* StorageFileQueryResult_GetCurrentQueryOptions(py::wrapper::Windows::Storage::Search::StorageFileQueryResult* 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.Storage.Search.StorageFileQueryResult", L"GetCurrentQueryOptions", 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.GetCurrentQueryOptions();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* StorageFileQueryResult_GetFilesAsync(py::wrapper::Windows::Storage::Search::StorageFileQueryResult* 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.Storage.Search.StorageFileQueryResult", L"GetFilesAsync", 2);
                }

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

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

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

    static PyObject* StorageFileQueryResult_GetFilesAsyncDefaultStartAndCount(py::wrapper::Windows::Storage::Search::StorageFileQueryResult* 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.Storage.Search.StorageFileQueryResult", L"GetFilesAsync", 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.GetFilesAsync();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* StorageFileQueryResult_GetItemCountAsync(py::wrapper::Windows::Storage::Search::StorageFileQueryResult* 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.Storage.Search.StorageFileQueryResult", L"GetItemCountAsync", 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.GetItemCountAsync();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* StorageFileQueryResult_GetMatchingPropertiesWithRanges(py::wrapper::Windows::Storage::Search::StorageFileQueryResult* 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.Storage.Search.StorageFileQueryResult", L"GetMatchingPropertiesWithRanges", 1);
                }

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

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

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

    static PyObject* StorageFileQueryResult_get_Folder(py::wrapper::Windows::Storage::Search::StorageFileQueryResult* 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.Storage.Search.StorageFileQueryResult", L"Folder");
            }

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

    static PyObject* StorageFileQueryResult_add_ContentsChanged(py::wrapper::Windows::Storage::Search::StorageFileQueryResult* 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.Storage.Search.StorageFileQueryResult", L"ContentsChanged");
            }

            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::Storage::Search::IStorageQueryResultBase, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* StorageFileQueryResult_remove_ContentsChanged(py::wrapper::Windows::Storage::Search::StorageFileQueryResult* 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.Storage.Search.StorageFileQueryResult", L"ContentsChanged");
            }

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

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

    static PyObject* StorageFileQueryResult_add_OptionsChanged(py::wrapper::Windows::Storage::Search::StorageFileQueryResult* 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.Storage.Search.StorageFileQueryResult", L"OptionsChanged");
            }

            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::Storage::Search::IStorageQueryResultBase, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* StorageFileQueryResult_remove_OptionsChanged(py::wrapper::Windows::Storage::Search::StorageFileQueryResult* 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.Storage.Search.StorageFileQueryResult", L"OptionsChanged");
            }

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

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

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

    static PyObject* _from_StorageFileQueryResult(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::Storage::Search::StorageFileQueryResult>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_StorageFileQueryResult[] = {
        { "apply_new_query_options", reinterpret_cast<PyCFunction>(StorageFileQueryResult_ApplyNewQueryOptions), METH_VARARGS, nullptr },
        { "find_start_index_async", reinterpret_cast<PyCFunction>(StorageFileQueryResult_FindStartIndexAsync), METH_VARARGS, nullptr },
        { "get_current_query_options", reinterpret_cast<PyCFunction>(StorageFileQueryResult_GetCurrentQueryOptions), METH_VARARGS, nullptr },
        { "get_files_async", reinterpret_cast<PyCFunction>(StorageFileQueryResult_GetFilesAsync), METH_VARARGS, nullptr },
        { "get_files_async_default_start_and_count", reinterpret_cast<PyCFunction>(StorageFileQueryResult_GetFilesAsyncDefaultStartAndCount), METH_VARARGS, nullptr },
        { "get_item_count_async", reinterpret_cast<PyCFunction>(StorageFileQueryResult_GetItemCountAsync), METH_VARARGS, nullptr },
        { "get_matching_properties_with_ranges", reinterpret_cast<PyCFunction>(StorageFileQueryResult_GetMatchingPropertiesWithRanges), METH_VARARGS, nullptr },
        { "add_contents_changed", reinterpret_cast<PyCFunction>(StorageFileQueryResult_add_ContentsChanged), METH_O, nullptr },
        { "remove_contents_changed", reinterpret_cast<PyCFunction>(StorageFileQueryResult_remove_ContentsChanged), METH_O, nullptr },
        { "add_options_changed", reinterpret_cast<PyCFunction>(StorageFileQueryResult_add_OptionsChanged), METH_O, nullptr },
        { "remove_options_changed", reinterpret_cast<PyCFunction>(StorageFileQueryResult_remove_OptionsChanged), METH_O, nullptr },
        { "_assign_array_", _assign_array_StorageFileQueryResult, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_StorageFileQueryResult), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_StorageFileQueryResult[] = {
        { "folder", reinterpret_cast<getter>(StorageFileQueryResult_get_Folder), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_StorageFileQueryResult[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_StorageFileQueryResult) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_StorageFileQueryResult) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_StorageFileQueryResult) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_StorageFileQueryResult) },
        { }};

    static PyType_Spec type_spec_StorageFileQueryResult = {
        "winrt._winrt_windows_storage_search.StorageFileQueryResult",
        sizeof(py::wrapper::Windows::Storage::Search::StorageFileQueryResult),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_StorageFileQueryResult};

    // ----- StorageFolderQueryResult class --------------------

    static PyObject* _new_StorageFolderQueryResult(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Storage::Search::StorageFolderQueryResult>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Storage::Search::StorageFolderQueryResult>::type_name);
        return nullptr;
    }

    static void _dealloc_StorageFolderQueryResult(py::wrapper::Windows::Storage::Search::StorageFolderQueryResult* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* StorageFolderQueryResult_ApplyNewQueryOptions(py::wrapper::Windows::Storage::Search::StorageFolderQueryResult* 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.Storage.Search.StorageFolderQueryResult", L"ApplyNewQueryOptions", 1);
                }

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

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

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

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

    static PyObject* StorageFolderQueryResult_FindStartIndexAsync(py::wrapper::Windows::Storage::Search::StorageFolderQueryResult* 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.Storage.Search.StorageFolderQueryResult", L"FindStartIndexAsync", 1);
                }

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

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

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

    static PyObject* StorageFolderQueryResult_GetCurrentQueryOptions(py::wrapper::Windows::Storage::Search::StorageFolderQueryResult* 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.Storage.Search.StorageFolderQueryResult", L"GetCurrentQueryOptions", 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.GetCurrentQueryOptions();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* StorageFolderQueryResult_GetFoldersAsync(py::wrapper::Windows::Storage::Search::StorageFolderQueryResult* 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.Storage.Search.StorageFolderQueryResult", L"GetFoldersAsync", 2);
                }

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

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

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

    static PyObject* StorageFolderQueryResult_GetFoldersAsyncDefaultStartAndCount(py::wrapper::Windows::Storage::Search::StorageFolderQueryResult* 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.Storage.Search.StorageFolderQueryResult", L"GetFoldersAsync", 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.GetFoldersAsync();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* StorageFolderQueryResult_GetItemCountAsync(py::wrapper::Windows::Storage::Search::StorageFolderQueryResult* 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.Storage.Search.StorageFolderQueryResult", L"GetItemCountAsync", 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.GetItemCountAsync();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* StorageFolderQueryResult_get_Folder(py::wrapper::Windows::Storage::Search::StorageFolderQueryResult* 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.Storage.Search.StorageFolderQueryResult", L"Folder");
            }

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

    static PyObject* StorageFolderQueryResult_add_ContentsChanged(py::wrapper::Windows::Storage::Search::StorageFolderQueryResult* 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.Storage.Search.StorageFolderQueryResult", L"ContentsChanged");
            }

            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::Storage::Search::IStorageQueryResultBase, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* StorageFolderQueryResult_remove_ContentsChanged(py::wrapper::Windows::Storage::Search::StorageFolderQueryResult* 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.Storage.Search.StorageFolderQueryResult", L"ContentsChanged");
            }

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

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

    static PyObject* StorageFolderQueryResult_add_OptionsChanged(py::wrapper::Windows::Storage::Search::StorageFolderQueryResult* 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.Storage.Search.StorageFolderQueryResult", L"OptionsChanged");
            }

            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::Storage::Search::IStorageQueryResultBase, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* StorageFolderQueryResult_remove_OptionsChanged(py::wrapper::Windows::Storage::Search::StorageFolderQueryResult* 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.Storage.Search.StorageFolderQueryResult", L"OptionsChanged");
            }

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

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

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

    static PyObject* _from_StorageFolderQueryResult(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::Storage::Search::StorageFolderQueryResult>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_StorageFolderQueryResult[] = {
        { "apply_new_query_options", reinterpret_cast<PyCFunction>(StorageFolderQueryResult_ApplyNewQueryOptions), METH_VARARGS, nullptr },
        { "find_start_index_async", reinterpret_cast<PyCFunction>(StorageFolderQueryResult_FindStartIndexAsync), METH_VARARGS, nullptr },
        { "get_current_query_options", reinterpret_cast<PyCFunction>(StorageFolderQueryResult_GetCurrentQueryOptions), METH_VARARGS, nullptr },
        { "get_folders_async", reinterpret_cast<PyCFunction>(StorageFolderQueryResult_GetFoldersAsync), METH_VARARGS, nullptr },
        { "get_folders_async_default_start_and_count", reinterpret_cast<PyCFunction>(StorageFolderQueryResult_GetFoldersAsyncDefaultStartAndCount), METH_VARARGS, nullptr },
        { "get_item_count_async", reinterpret_cast<PyCFunction>(StorageFolderQueryResult_GetItemCountAsync), METH_VARARGS, nullptr },
        { "add_contents_changed", reinterpret_cast<PyCFunction>(StorageFolderQueryResult_add_ContentsChanged), METH_O, nullptr },
        { "remove_contents_changed", reinterpret_cast<PyCFunction>(StorageFolderQueryResult_remove_ContentsChanged), METH_O, nullptr },
        { "add_options_changed", reinterpret_cast<PyCFunction>(StorageFolderQueryResult_add_OptionsChanged), METH_O, nullptr },
        { "remove_options_changed", reinterpret_cast<PyCFunction>(StorageFolderQueryResult_remove_OptionsChanged), METH_O, nullptr },
        { "_assign_array_", _assign_array_StorageFolderQueryResult, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_StorageFolderQueryResult), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_StorageFolderQueryResult[] = {
        { "folder", reinterpret_cast<getter>(StorageFolderQueryResult_get_Folder), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_StorageFolderQueryResult[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_StorageFolderQueryResult) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_StorageFolderQueryResult) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_StorageFolderQueryResult) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_StorageFolderQueryResult) },
        { }};

    static PyType_Spec type_spec_StorageFolderQueryResult = {
        "winrt._winrt_windows_storage_search.StorageFolderQueryResult",
        sizeof(py::wrapper::Windows::Storage::Search::StorageFolderQueryResult),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_StorageFolderQueryResult};

    // ----- StorageItemQueryResult class --------------------

    static PyObject* _new_StorageItemQueryResult(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Storage::Search::StorageItemQueryResult>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Storage::Search::StorageItemQueryResult>::type_name);
        return nullptr;
    }

    static void _dealloc_StorageItemQueryResult(py::wrapper::Windows::Storage::Search::StorageItemQueryResult* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* StorageItemQueryResult_ApplyNewQueryOptions(py::wrapper::Windows::Storage::Search::StorageItemQueryResult* 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.Storage.Search.StorageItemQueryResult", L"ApplyNewQueryOptions", 1);
                }

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

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

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

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

    static PyObject* StorageItemQueryResult_FindStartIndexAsync(py::wrapper::Windows::Storage::Search::StorageItemQueryResult* 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.Storage.Search.StorageItemQueryResult", L"FindStartIndexAsync", 1);
                }

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

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

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

    static PyObject* StorageItemQueryResult_GetCurrentQueryOptions(py::wrapper::Windows::Storage::Search::StorageItemQueryResult* 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.Storage.Search.StorageItemQueryResult", L"GetCurrentQueryOptions", 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.GetCurrentQueryOptions();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* StorageItemQueryResult_GetItemCountAsync(py::wrapper::Windows::Storage::Search::StorageItemQueryResult* 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.Storage.Search.StorageItemQueryResult", L"GetItemCountAsync", 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.GetItemCountAsync();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* StorageItemQueryResult_GetItemsAsync(py::wrapper::Windows::Storage::Search::StorageItemQueryResult* 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.Storage.Search.StorageItemQueryResult", L"GetItemsAsync", 2);
                }

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

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

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

    static PyObject* StorageItemQueryResult_GetItemsAsyncDefaultStartAndCount(py::wrapper::Windows::Storage::Search::StorageItemQueryResult* 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.Storage.Search.StorageItemQueryResult", L"GetItemsAsync", 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.GetItemsAsync();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* StorageItemQueryResult_get_Folder(py::wrapper::Windows::Storage::Search::StorageItemQueryResult* 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.Storage.Search.StorageItemQueryResult", L"Folder");
            }

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

    static PyObject* StorageItemQueryResult_add_ContentsChanged(py::wrapper::Windows::Storage::Search::StorageItemQueryResult* 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.Storage.Search.StorageItemQueryResult", L"ContentsChanged");
            }

            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::Storage::Search::IStorageQueryResultBase, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* StorageItemQueryResult_remove_ContentsChanged(py::wrapper::Windows::Storage::Search::StorageItemQueryResult* 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.Storage.Search.StorageItemQueryResult", L"ContentsChanged");
            }

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

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

    static PyObject* StorageItemQueryResult_add_OptionsChanged(py::wrapper::Windows::Storage::Search::StorageItemQueryResult* 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.Storage.Search.StorageItemQueryResult", L"OptionsChanged");
            }

            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::Storage::Search::IStorageQueryResultBase, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* StorageItemQueryResult_remove_OptionsChanged(py::wrapper::Windows::Storage::Search::StorageItemQueryResult* 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.Storage.Search.StorageItemQueryResult", L"OptionsChanged");
            }

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

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

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

    static PyObject* _from_StorageItemQueryResult(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::Storage::Search::StorageItemQueryResult>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_StorageItemQueryResult[] = {
        { "apply_new_query_options", reinterpret_cast<PyCFunction>(StorageItemQueryResult_ApplyNewQueryOptions), METH_VARARGS, nullptr },
        { "find_start_index_async", reinterpret_cast<PyCFunction>(StorageItemQueryResult_FindStartIndexAsync), METH_VARARGS, nullptr },
        { "get_current_query_options", reinterpret_cast<PyCFunction>(StorageItemQueryResult_GetCurrentQueryOptions), METH_VARARGS, nullptr },
        { "get_item_count_async", reinterpret_cast<PyCFunction>(StorageItemQueryResult_GetItemCountAsync), METH_VARARGS, nullptr },
        { "get_items_async", reinterpret_cast<PyCFunction>(StorageItemQueryResult_GetItemsAsync), METH_VARARGS, nullptr },
        { "get_items_async_default_start_and_count", reinterpret_cast<PyCFunction>(StorageItemQueryResult_GetItemsAsyncDefaultStartAndCount), METH_VARARGS, nullptr },
        { "add_contents_changed", reinterpret_cast<PyCFunction>(StorageItemQueryResult_add_ContentsChanged), METH_O, nullptr },
        { "remove_contents_changed", reinterpret_cast<PyCFunction>(StorageItemQueryResult_remove_ContentsChanged), METH_O, nullptr },
        { "add_options_changed", reinterpret_cast<PyCFunction>(StorageItemQueryResult_add_OptionsChanged), METH_O, nullptr },
        { "remove_options_changed", reinterpret_cast<PyCFunction>(StorageItemQueryResult_remove_OptionsChanged), METH_O, nullptr },
        { "_assign_array_", _assign_array_StorageItemQueryResult, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_StorageItemQueryResult), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_StorageItemQueryResult[] = {
        { "folder", reinterpret_cast<getter>(StorageItemQueryResult_get_Folder), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_StorageItemQueryResult[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_StorageItemQueryResult) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_StorageItemQueryResult) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_StorageItemQueryResult) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_StorageItemQueryResult) },
        { }};

    static PyType_Spec type_spec_StorageItemQueryResult = {
        "winrt._winrt_windows_storage_search.StorageItemQueryResult",
        sizeof(py::wrapper::Windows::Storage::Search::StorageItemQueryResult),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_StorageItemQueryResult};

    // ----- StorageLibraryChangeTrackerTriggerDetails class --------------------

    static PyObject* _new_StorageLibraryChangeTrackerTriggerDetails(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Storage::Search::StorageLibraryChangeTrackerTriggerDetails>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Storage::Search::StorageLibraryChangeTrackerTriggerDetails>::type_name);
        return nullptr;
    }

    static void _dealloc_StorageLibraryChangeTrackerTriggerDetails(py::wrapper::Windows::Storage::Search::StorageLibraryChangeTrackerTriggerDetails* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* StorageLibraryChangeTrackerTriggerDetails_get_ChangeTracker(py::wrapper::Windows::Storage::Search::StorageLibraryChangeTrackerTriggerDetails* 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.Storage.Search.StorageLibraryChangeTrackerTriggerDetails", L"ChangeTracker");
            }

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

    static PyObject* StorageLibraryChangeTrackerTriggerDetails_get_Folder(py::wrapper::Windows::Storage::Search::StorageLibraryChangeTrackerTriggerDetails* 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.Storage.Search.StorageLibraryChangeTrackerTriggerDetails", L"Folder");
            }

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

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

    static PyObject* _from_StorageLibraryChangeTrackerTriggerDetails(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::Storage::Search::StorageLibraryChangeTrackerTriggerDetails>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_StorageLibraryChangeTrackerTriggerDetails[] = {
        { "_assign_array_", _assign_array_StorageLibraryChangeTrackerTriggerDetails, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_StorageLibraryChangeTrackerTriggerDetails), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_StorageLibraryChangeTrackerTriggerDetails[] = {
        { "change_tracker", reinterpret_cast<getter>(StorageLibraryChangeTrackerTriggerDetails_get_ChangeTracker), nullptr, nullptr, nullptr },
        { "folder", reinterpret_cast<getter>(StorageLibraryChangeTrackerTriggerDetails_get_Folder), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_StorageLibraryChangeTrackerTriggerDetails[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_StorageLibraryChangeTrackerTriggerDetails) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_StorageLibraryChangeTrackerTriggerDetails) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_StorageLibraryChangeTrackerTriggerDetails) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_StorageLibraryChangeTrackerTriggerDetails) },
        { }};

    static PyType_Spec type_spec_StorageLibraryChangeTrackerTriggerDetails = {
        "winrt._winrt_windows_storage_search.StorageLibraryChangeTrackerTriggerDetails",
        sizeof(py::wrapper::Windows::Storage::Search::StorageLibraryChangeTrackerTriggerDetails),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_StorageLibraryChangeTrackerTriggerDetails};

    // ----- StorageLibraryContentChangedTriggerDetails class --------------------

    static PyObject* _new_StorageLibraryContentChangedTriggerDetails(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Storage::Search::StorageLibraryContentChangedTriggerDetails>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Storage::Search::StorageLibraryContentChangedTriggerDetails>::type_name);
        return nullptr;
    }

    static void _dealloc_StorageLibraryContentChangedTriggerDetails(py::wrapper::Windows::Storage::Search::StorageLibraryContentChangedTriggerDetails* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* StorageLibraryContentChangedTriggerDetails_CreateModifiedSinceQuery(py::wrapper::Windows::Storage::Search::StorageLibraryContentChangedTriggerDetails* 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.Storage.Search.StorageLibraryContentChangedTriggerDetails", L"CreateModifiedSinceQuery", 1);
                }

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

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

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

    static PyObject* StorageLibraryContentChangedTriggerDetails_get_Folder(py::wrapper::Windows::Storage::Search::StorageLibraryContentChangedTriggerDetails* 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.Storage.Search.StorageLibraryContentChangedTriggerDetails", L"Folder");
            }

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

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

    static PyObject* _from_StorageLibraryContentChangedTriggerDetails(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::Storage::Search::StorageLibraryContentChangedTriggerDetails>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_StorageLibraryContentChangedTriggerDetails[] = {
        { "create_modified_since_query", reinterpret_cast<PyCFunction>(StorageLibraryContentChangedTriggerDetails_CreateModifiedSinceQuery), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_StorageLibraryContentChangedTriggerDetails, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_StorageLibraryContentChangedTriggerDetails), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_StorageLibraryContentChangedTriggerDetails[] = {
        { "folder", reinterpret_cast<getter>(StorageLibraryContentChangedTriggerDetails_get_Folder), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_StorageLibraryContentChangedTriggerDetails[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_StorageLibraryContentChangedTriggerDetails) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_StorageLibraryContentChangedTriggerDetails) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_StorageLibraryContentChangedTriggerDetails) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_StorageLibraryContentChangedTriggerDetails) },
        { }};

    static PyType_Spec type_spec_StorageLibraryContentChangedTriggerDetails = {
        "winrt._winrt_windows_storage_search.StorageLibraryContentChangedTriggerDetails",
        sizeof(py::wrapper::Windows::Storage::Search::StorageLibraryContentChangedTriggerDetails),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_StorageLibraryContentChangedTriggerDetails};

    // ----- ValueAndLanguage class --------------------

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

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

    static PyObject* ValueAndLanguage_get_Value(py::wrapper::Windows::Storage::Search::ValueAndLanguage* 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.Storage.Search.ValueAndLanguage", L"Value");
            }

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

    static int ValueAndLanguage_put_Value(py::wrapper::Windows::Storage::Search::ValueAndLanguage* 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.Storage.Search.ValueAndLanguage", L"Value");
            }

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

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

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

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

    static PyObject* ValueAndLanguage_get_Language(py::wrapper::Windows::Storage::Search::ValueAndLanguage* 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.Storage.Search.ValueAndLanguage", L"Language");
            }

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

    static int ValueAndLanguage_put_Language(py::wrapper::Windows::Storage::Search::ValueAndLanguage* 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.Storage.Search.ValueAndLanguage", L"Language");
            }

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

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

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

    static PyObject* _from_ValueAndLanguage(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::Storage::Search::ValueAndLanguage>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_ValueAndLanguage[] = {
        { "_assign_array_", _assign_array_ValueAndLanguage, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_ValueAndLanguage), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_ValueAndLanguage[] = {
        { "value", reinterpret_cast<getter>(ValueAndLanguage_get_Value), reinterpret_cast<setter>(ValueAndLanguage_put_Value), nullptr, nullptr },
        { "language", reinterpret_cast<getter>(ValueAndLanguage_get_Language), reinterpret_cast<setter>(ValueAndLanguage_put_Language), nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_ValueAndLanguage[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_ValueAndLanguage) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_ValueAndLanguage) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_ValueAndLanguage) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_ValueAndLanguage) },
        { }};

    static PyType_Spec type_spec_ValueAndLanguage = {
        "winrt._winrt_windows_storage_search.ValueAndLanguage",
        sizeof(py::wrapper::Windows::Storage::Search::ValueAndLanguage),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_ValueAndLanguage};

    // ----- IIndexableContent interface --------------------

    #if PY_VERSION_HEX < 0x030A0000
    static PyObject* _new_IIndexableContent(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Storage::Search::IIndexableContent>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Storage::Search::IIndexableContent>::type_name);
        return nullptr;
    }
    #endif

    static void _dealloc_IIndexableContent(py::wrapper::Windows::Storage::Search::IIndexableContent* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* IIndexableContent_get_Id(py::wrapper::Windows::Storage::Search::IIndexableContent* 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.Storage.Search.IIndexableContent", 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 int IIndexableContent_put_Id(py::wrapper::Windows::Storage::Search::IIndexableContent* 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.Storage.Search.IIndexableContent", L"Id");
            }

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

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

    static PyObject* IIndexableContent_get_Properties(py::wrapper::Windows::Storage::Search::IIndexableContent* 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.Storage.Search.IIndexableContent", L"Properties");
            }

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

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

    static PyObject* IIndexableContent_get_Stream(py::wrapper::Windows::Storage::Search::IIndexableContent* 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.Storage.Search.IIndexableContent", L"Stream");
            }

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

    static int IIndexableContent_put_Stream(py::wrapper::Windows::Storage::Search::IIndexableContent* 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.Storage.Search.IIndexableContent", L"Stream");
            }

            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::Storage::Streams::IRandomAccessStream>(arg);

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

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

    static PyObject* IIndexableContent_get_StreamContentType(py::wrapper::Windows::Storage::Search::IIndexableContent* 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.Storage.Search.IIndexableContent", L"StreamContentType");
            }

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

    static int IIndexableContent_put_StreamContentType(py::wrapper::Windows::Storage::Search::IIndexableContent* 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.Storage.Search.IIndexableContent", L"StreamContentType");
            }

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

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

    static PyMethodDef _methods_IIndexableContent[] = {
        { }};

    static PyGetSetDef _getset_IIndexableContent[] = {
        { "id", reinterpret_cast<getter>(IIndexableContent_get_Id), reinterpret_cast<setter>(IIndexableContent_put_Id), nullptr, nullptr },
        { "properties", reinterpret_cast<getter>(IIndexableContent_get_Properties), nullptr, nullptr, nullptr },
        { "stream", reinterpret_cast<getter>(IIndexableContent_get_Stream), reinterpret_cast<setter>(IIndexableContent_put_Stream), nullptr, nullptr },
        { "stream_content_type", reinterpret_cast<getter>(IIndexableContent_get_StreamContentType), reinterpret_cast<setter>(IIndexableContent_put_StreamContentType), nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_IIndexableContent[] = {
        #if PY_VERSION_HEX < 0x030A0000
        { Py_tp_new, reinterpret_cast<void*>(_new_IIndexableContent) },
        #endif
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IIndexableContent) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IIndexableContent) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IIndexableContent) },
        { }};

    static PyType_Spec type_spec_IIndexableContent = {
        "winrt._winrt_windows_storage_search._IIndexableContent",
        sizeof(py::wrapper::Windows::Storage::Search::IIndexableContent),
        0,
        Py_TPFLAGS_DEFAULT
        #if PY_VERSION_HEX >= 0x030A0000
        | Py_TPFLAGS_DISALLOW_INSTANTIATION
        #endif
        ,
        _type_slots_IIndexableContent};

    struct ImplementsIIndexableContent : py::ImplementsInterfaceT<ImplementsIIndexableContent, winrt::Windows::Storage::Search::IIndexableContent>
    {
        ImplementsIIndexableContent() = delete;
        ImplementsIIndexableContent(PyObject* py_obj, winrt::impl::inspectable_abi* runtime_class) : py::ImplementsInterfaceT<ImplementsIIndexableContent, winrt::Windows::Storage::Search::IIndexableContent>(py_obj, runtime_class)
        {
        }

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

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

                return py::convert_to<winrt::hstring>(value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        void Id(winrt::hstring const& param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

                if (PyObject_SetAttrString(self.get(), "id", value.get()) == -1)
                {
                    throw python_exception();
                }
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

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

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

                return py::convert_to<winrt::Windows::Foundation::Collections::IMap<winrt::hstring, winrt::Windows::Foundation::IInspectable>>(value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

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

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

                return py::convert_to<winrt::Windows::Storage::Streams::IRandomAccessStream>(value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        void Stream(winrt::Windows::Storage::Streams::IRandomAccessStream const& param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

                if (PyObject_SetAttrString(self.get(), "stream", value.get()) == -1)
                {
                    throw python_exception();
                }
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

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

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

                return py::convert_to<winrt::hstring>(value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        void StreamContentType(winrt::hstring const& param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

                if (PyObject_SetAttrString(self.get(), "stream_content_type", value.get()) == -1)
                {
                    throw python_exception();
                }
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }
    };

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

    static PyObject* _from_IIndexableContent(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::Storage::Search::IIndexableContent>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _guid_ImplementsIIndexableContent(PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::guid_of<winrt::Windows::Storage::Search::IIndexableContent>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

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

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

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

    static PyMethodDef methods_ImplementsIIndexableContent[] = {
        { "_assign_array_", _assign_array_IIndexableContent, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_IIndexableContent), METH_O | METH_STATIC, nullptr },
        { "_guid_", reinterpret_cast<PyCFunction>(_guid_ImplementsIIndexableContent), METH_NOARGS | METH_STATIC, nullptr },
        { "_make_", reinterpret_cast<PyCFunction>(_make_ImplementsIIndexableContent), METH_VARARGS | METH_STATIC, nullptr },
        { }};

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

    static PyType_Spec type_spec_ImplementsIIndexableContent = {
        "winrt._winrt_windows_storage_search.IIndexableContent",
        0,
        0,
        Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE
        #if PY_VERSION_HEX >= 0x030A0000
        | Py_TPFLAGS_DISALLOW_INSTANTIATION
        #endif
        ,
        type_slots_ImplementsIIndexableContent};

    // ----- IStorageFolderQueryOperations interface --------------------

    #if PY_VERSION_HEX < 0x030A0000
    static PyObject* _new_IStorageFolderQueryOperations(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Storage::Search::IStorageFolderQueryOperations>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Storage::Search::IStorageFolderQueryOperations>::type_name);
        return nullptr;
    }
    #endif

    static void _dealloc_IStorageFolderQueryOperations(py::wrapper::Windows::Storage::Search::IStorageFolderQueryOperations* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* IStorageFolderQueryOperations_AreQueryOptionsSupported(py::wrapper::Windows::Storage::Search::IStorageFolderQueryOperations* 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.Storage.Search.IStorageFolderQueryOperations", L"AreQueryOptionsSupported", 1);
                }

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

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

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

    static PyObject* IStorageFolderQueryOperations_CreateFileQuery(py::wrapper::Windows::Storage::Search::IStorageFolderQueryOperations* 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.Storage.Search.IStorageFolderQueryOperations", L"CreateFileQuery", 1);
                }

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

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

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

    static PyObject* IStorageFolderQueryOperations_CreateFileQueryOverloadDefault(py::wrapper::Windows::Storage::Search::IStorageFolderQueryOperations* 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.Storage.Search.IStorageFolderQueryOperations", L"CreateFileQuery", 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.CreateFileQuery();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* IStorageFolderQueryOperations_CreateFileQueryWithOptions(py::wrapper::Windows::Storage::Search::IStorageFolderQueryOperations* 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.Storage.Search.IStorageFolderQueryOperations", L"CreateFileQueryWithOptions", 1);
                }

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

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

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

    static PyObject* IStorageFolderQueryOperations_CreateFolderQuery(py::wrapper::Windows::Storage::Search::IStorageFolderQueryOperations* 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.Storage.Search.IStorageFolderQueryOperations", L"CreateFolderQuery", 1);
                }

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

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

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

    static PyObject* IStorageFolderQueryOperations_CreateFolderQueryOverloadDefault(py::wrapper::Windows::Storage::Search::IStorageFolderQueryOperations* 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.Storage.Search.IStorageFolderQueryOperations", L"CreateFolderQuery", 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.CreateFolderQuery();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* IStorageFolderQueryOperations_CreateFolderQueryWithOptions(py::wrapper::Windows::Storage::Search::IStorageFolderQueryOperations* 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.Storage.Search.IStorageFolderQueryOperations", L"CreateFolderQueryWithOptions", 1);
                }

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

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

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

    static PyObject* IStorageFolderQueryOperations_CreateItemQuery(py::wrapper::Windows::Storage::Search::IStorageFolderQueryOperations* 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.Storage.Search.IStorageFolderQueryOperations", L"CreateItemQuery", 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.CreateItemQuery();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* IStorageFolderQueryOperations_CreateItemQueryWithOptions(py::wrapper::Windows::Storage::Search::IStorageFolderQueryOperations* 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.Storage.Search.IStorageFolderQueryOperations", L"CreateItemQueryWithOptions", 1);
                }

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

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

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

    static PyObject* IStorageFolderQueryOperations_GetFilesAsync(py::wrapper::Windows::Storage::Search::IStorageFolderQueryOperations* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 3)
        {
            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.Storage.Search.IStorageFolderQueryOperations", L"GetFilesAsync", 3);
                }

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

                auto param0 = py::convert_to<winrt::Windows::Storage::Search::CommonFileQuery>(args, 0);
                auto param1 = py::convert_to<uint32_t>(args, 1);
                auto param2 = py::convert_to<uint32_t>(args, 2);

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

    static PyObject* IStorageFolderQueryOperations_GetFilesAsyncOverloadDefaultStartAndCount(py::wrapper::Windows::Storage::Search::IStorageFolderQueryOperations* 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.Storage.Search.IStorageFolderQueryOperations", L"GetFilesAsync", 1);
                }

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

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

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

    static PyObject* IStorageFolderQueryOperations_GetFoldersAsync(py::wrapper::Windows::Storage::Search::IStorageFolderQueryOperations* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 3)
        {
            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.Storage.Search.IStorageFolderQueryOperations", L"GetFoldersAsync", 3);
                }

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

                auto param0 = py::convert_to<winrt::Windows::Storage::Search::CommonFolderQuery>(args, 0);
                auto param1 = py::convert_to<uint32_t>(args, 1);
                auto param2 = py::convert_to<uint32_t>(args, 2);

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

    static PyObject* IStorageFolderQueryOperations_GetFoldersAsyncOverloadDefaultStartAndCount(py::wrapper::Windows::Storage::Search::IStorageFolderQueryOperations* 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.Storage.Search.IStorageFolderQueryOperations", L"GetFoldersAsync", 1);
                }

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

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

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

    static PyObject* IStorageFolderQueryOperations_GetIndexedStateAsync(py::wrapper::Windows::Storage::Search::IStorageFolderQueryOperations* 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.Storage.Search.IStorageFolderQueryOperations", L"GetIndexedStateAsync", 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.GetIndexedStateAsync();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* IStorageFolderQueryOperations_GetItemsAsync(py::wrapper::Windows::Storage::Search::IStorageFolderQueryOperations* 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.Storage.Search.IStorageFolderQueryOperations", L"GetItemsAsync", 2);
                }

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

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

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

    static PyObject* IStorageFolderQueryOperations_IsCommonFileQuerySupported(py::wrapper::Windows::Storage::Search::IStorageFolderQueryOperations* 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.Storage.Search.IStorageFolderQueryOperations", L"IsCommonFileQuerySupported", 1);
                }

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

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

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

    static PyObject* IStorageFolderQueryOperations_IsCommonFolderQuerySupported(py::wrapper::Windows::Storage::Search::IStorageFolderQueryOperations* 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.Storage.Search.IStorageFolderQueryOperations", L"IsCommonFolderQuerySupported", 1);
                }

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

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

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

    static PyMethodDef _methods_IStorageFolderQueryOperations[] = {
        { "are_query_options_supported", reinterpret_cast<PyCFunction>(IStorageFolderQueryOperations_AreQueryOptionsSupported), METH_VARARGS, nullptr },
        { "create_file_query", reinterpret_cast<PyCFunction>(IStorageFolderQueryOperations_CreateFileQuery), METH_VARARGS, nullptr },
        { "create_file_query_overload_default", reinterpret_cast<PyCFunction>(IStorageFolderQueryOperations_CreateFileQueryOverloadDefault), METH_VARARGS, nullptr },
        { "create_file_query_with_options", reinterpret_cast<PyCFunction>(IStorageFolderQueryOperations_CreateFileQueryWithOptions), METH_VARARGS, nullptr },
        { "create_folder_query", reinterpret_cast<PyCFunction>(IStorageFolderQueryOperations_CreateFolderQuery), METH_VARARGS, nullptr },
        { "create_folder_query_overload_default", reinterpret_cast<PyCFunction>(IStorageFolderQueryOperations_CreateFolderQueryOverloadDefault), METH_VARARGS, nullptr },
        { "create_folder_query_with_options", reinterpret_cast<PyCFunction>(IStorageFolderQueryOperations_CreateFolderQueryWithOptions), METH_VARARGS, nullptr },
        { "create_item_query", reinterpret_cast<PyCFunction>(IStorageFolderQueryOperations_CreateItemQuery), METH_VARARGS, nullptr },
        { "create_item_query_with_options", reinterpret_cast<PyCFunction>(IStorageFolderQueryOperations_CreateItemQueryWithOptions), METH_VARARGS, nullptr },
        { "get_files_async", reinterpret_cast<PyCFunction>(IStorageFolderQueryOperations_GetFilesAsync), METH_VARARGS, nullptr },
        { "get_files_async_overload_default_start_and_count", reinterpret_cast<PyCFunction>(IStorageFolderQueryOperations_GetFilesAsyncOverloadDefaultStartAndCount), METH_VARARGS, nullptr },
        { "get_folders_async", reinterpret_cast<PyCFunction>(IStorageFolderQueryOperations_GetFoldersAsync), METH_VARARGS, nullptr },
        { "get_folders_async_overload_default_start_and_count", reinterpret_cast<PyCFunction>(IStorageFolderQueryOperations_GetFoldersAsyncOverloadDefaultStartAndCount), METH_VARARGS, nullptr },
        { "get_indexed_state_async", reinterpret_cast<PyCFunction>(IStorageFolderQueryOperations_GetIndexedStateAsync), METH_VARARGS, nullptr },
        { "get_items_async", reinterpret_cast<PyCFunction>(IStorageFolderQueryOperations_GetItemsAsync), METH_VARARGS, nullptr },
        { "is_common_file_query_supported", reinterpret_cast<PyCFunction>(IStorageFolderQueryOperations_IsCommonFileQuerySupported), METH_VARARGS, nullptr },
        { "is_common_folder_query_supported", reinterpret_cast<PyCFunction>(IStorageFolderQueryOperations_IsCommonFolderQuerySupported), METH_VARARGS, nullptr },
        { }};

    static PyGetSetDef _getset_IStorageFolderQueryOperations[] = {
        { }};

    static PyType_Slot _type_slots_IStorageFolderQueryOperations[] = {
        #if PY_VERSION_HEX < 0x030A0000
        { Py_tp_new, reinterpret_cast<void*>(_new_IStorageFolderQueryOperations) },
        #endif
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IStorageFolderQueryOperations) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IStorageFolderQueryOperations) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IStorageFolderQueryOperations) },
        { }};

    static PyType_Spec type_spec_IStorageFolderQueryOperations = {
        "winrt._winrt_windows_storage_search._IStorageFolderQueryOperations",
        sizeof(py::wrapper::Windows::Storage::Search::IStorageFolderQueryOperations),
        0,
        Py_TPFLAGS_DEFAULT
        #if PY_VERSION_HEX >= 0x030A0000
        | Py_TPFLAGS_DISALLOW_INSTANTIATION
        #endif
        ,
        _type_slots_IStorageFolderQueryOperations};

    struct ImplementsIStorageFolderQueryOperations : py::ImplementsInterfaceT<ImplementsIStorageFolderQueryOperations, winrt::Windows::Storage::Search::IStorageFolderQueryOperations>
    {
        ImplementsIStorageFolderQueryOperations() = delete;
        ImplementsIStorageFolderQueryOperations(PyObject* py_obj, winrt::impl::inspectable_abi* runtime_class) : py::ImplementsInterfaceT<ImplementsIStorageFolderQueryOperations, winrt::Windows::Storage::Search::IStorageFolderQueryOperations>(py_obj, runtime_class)
        {
        }

        auto AreQueryOptionsSupported(winrt::Windows::Storage::Search::QueryOptions const& param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

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

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

                return py::convert_to<bool>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto CreateFileQuery(winrt::Windows::Storage::Search::CommonFileQuery param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

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

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

                return py::convert_to<winrt::Windows::Storage::Search::StorageFileQueryResult>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

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

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

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

                return py::convert_to<winrt::Windows::Storage::Search::StorageFileQueryResult>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto CreateFileQueryWithOptions(winrt::Windows::Storage::Search::QueryOptions const& param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

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

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

                return py::convert_to<winrt::Windows::Storage::Search::StorageFileQueryResult>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto CreateFolderQuery(winrt::Windows::Storage::Search::CommonFolderQuery param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

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

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

                return py::convert_to<winrt::Windows::Storage::Search::StorageFolderQueryResult>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

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

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

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

                return py::convert_to<winrt::Windows::Storage::Search::StorageFolderQueryResult>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto CreateFolderQueryWithOptions(winrt::Windows::Storage::Search::QueryOptions const& param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

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

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

                return py::convert_to<winrt::Windows::Storage::Search::StorageFolderQueryResult>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

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

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

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

                return py::convert_to<winrt::Windows::Storage::Search::StorageItemQueryResult>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto CreateItemQueryWithOptions(winrt::Windows::Storage::Search::QueryOptions const& param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

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

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

                return py::convert_to<winrt::Windows::Storage::Search::StorageItemQueryResult>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto GetFilesAsync(winrt::Windows::Storage::Search::CommonFileQuery param0, uint32_t param1, uint32_t param2)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

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

                py::pyobj_handle py_param1{py::convert(param1)};
                if (!py_param1)
                {
                    throw python_exception();
                }

                py::pyobj_handle py_param2{py::convert(param2)};
                if (!py_param2)
                {
                    throw python_exception();
                }

                py::pyobj_handle args{PyTuple_Pack(3, py_param0.get(), py_param1.get(), py_param2.get())};
                if (!args)
                {
                    throw python_exception();
                }

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

                return py::convert_to<winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Storage::StorageFile>>>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto GetFilesAsync(winrt::Windows::Storage::Search::CommonFileQuery param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

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

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

                return py::convert_to<winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Storage::StorageFile>>>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto GetFoldersAsync(winrt::Windows::Storage::Search::CommonFolderQuery param0, uint32_t param1, uint32_t param2)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

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

                py::pyobj_handle py_param1{py::convert(param1)};
                if (!py_param1)
                {
                    throw python_exception();
                }

                py::pyobj_handle py_param2{py::convert(param2)};
                if (!py_param2)
                {
                    throw python_exception();
                }

                py::pyobj_handle args{PyTuple_Pack(3, py_param0.get(), py_param1.get(), py_param2.get())};
                if (!args)
                {
                    throw python_exception();
                }

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

                return py::convert_to<winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Storage::StorageFolder>>>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto GetFoldersAsync(winrt::Windows::Storage::Search::CommonFolderQuery param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

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

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

                return py::convert_to<winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Storage::StorageFolder>>>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

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

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

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

                return py::convert_to<winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Storage::Search::IndexedState>>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

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

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

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

                py::pyobj_handle py_param1{py::convert(param1)};
                if (!py_param1)
                {
                    throw python_exception();
                }

                py::pyobj_handle args{PyTuple_Pack(2, py_param0.get(), py_param1.get())};
                if (!args)
                {
                    throw python_exception();
                }

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

                return py::convert_to<winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Storage::IStorageItem>>>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto IsCommonFileQuerySupported(winrt::Windows::Storage::Search::CommonFileQuery param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

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

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

                return py::convert_to<bool>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto IsCommonFolderQuerySupported(winrt::Windows::Storage::Search::CommonFolderQuery param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

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

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

                return py::convert_to<bool>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }
    };

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

    static PyObject* _from_IStorageFolderQueryOperations(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::Storage::Search::IStorageFolderQueryOperations>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _guid_ImplementsIStorageFolderQueryOperations(PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::guid_of<winrt::Windows::Storage::Search::IStorageFolderQueryOperations>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

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

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

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

    static PyMethodDef methods_ImplementsIStorageFolderQueryOperations[] = {
        { "_assign_array_", _assign_array_IStorageFolderQueryOperations, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_IStorageFolderQueryOperations), METH_O | METH_STATIC, nullptr },
        { "_guid_", reinterpret_cast<PyCFunction>(_guid_ImplementsIStorageFolderQueryOperations), METH_NOARGS | METH_STATIC, nullptr },
        { "_make_", reinterpret_cast<PyCFunction>(_make_ImplementsIStorageFolderQueryOperations), METH_VARARGS | METH_STATIC, nullptr },
        { }};

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

    static PyType_Spec type_spec_ImplementsIStorageFolderQueryOperations = {
        "winrt._winrt_windows_storage_search.IStorageFolderQueryOperations",
        0,
        0,
        Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE
        #if PY_VERSION_HEX >= 0x030A0000
        | Py_TPFLAGS_DISALLOW_INSTANTIATION
        #endif
        ,
        type_slots_ImplementsIStorageFolderQueryOperations};

    // ----- IStorageQueryResultBase interface --------------------

    #if PY_VERSION_HEX < 0x030A0000
    static PyObject* _new_IStorageQueryResultBase(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Storage::Search::IStorageQueryResultBase>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Storage::Search::IStorageQueryResultBase>::type_name);
        return nullptr;
    }
    #endif

    static void _dealloc_IStorageQueryResultBase(py::wrapper::Windows::Storage::Search::IStorageQueryResultBase* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* IStorageQueryResultBase_ApplyNewQueryOptions(py::wrapper::Windows::Storage::Search::IStorageQueryResultBase* 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.Storage.Search.IStorageQueryResultBase", L"ApplyNewQueryOptions", 1);
                }

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

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

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

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

    static PyObject* IStorageQueryResultBase_FindStartIndexAsync(py::wrapper::Windows::Storage::Search::IStorageQueryResultBase* 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.Storage.Search.IStorageQueryResultBase", L"FindStartIndexAsync", 1);
                }

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

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

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

    static PyObject* IStorageQueryResultBase_GetCurrentQueryOptions(py::wrapper::Windows::Storage::Search::IStorageQueryResultBase* 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.Storage.Search.IStorageQueryResultBase", L"GetCurrentQueryOptions", 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.GetCurrentQueryOptions();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* IStorageQueryResultBase_GetItemCountAsync(py::wrapper::Windows::Storage::Search::IStorageQueryResultBase* 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.Storage.Search.IStorageQueryResultBase", L"GetItemCountAsync", 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.GetItemCountAsync();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* IStorageQueryResultBase_get_Folder(py::wrapper::Windows::Storage::Search::IStorageQueryResultBase* 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.Storage.Search.IStorageQueryResultBase", L"Folder");
            }

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

    static PyObject* IStorageQueryResultBase_add_ContentsChanged(py::wrapper::Windows::Storage::Search::IStorageQueryResultBase* 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.Storage.Search.IStorageQueryResultBase", L"ContentsChanged");
            }

            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::Storage::Search::IStorageQueryResultBase, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* IStorageQueryResultBase_remove_ContentsChanged(py::wrapper::Windows::Storage::Search::IStorageQueryResultBase* 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.Storage.Search.IStorageQueryResultBase", L"ContentsChanged");
            }

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

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

    static PyObject* IStorageQueryResultBase_add_OptionsChanged(py::wrapper::Windows::Storage::Search::IStorageQueryResultBase* 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.Storage.Search.IStorageQueryResultBase", L"OptionsChanged");
            }

            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::Storage::Search::IStorageQueryResultBase, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* IStorageQueryResultBase_remove_OptionsChanged(py::wrapper::Windows::Storage::Search::IStorageQueryResultBase* 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.Storage.Search.IStorageQueryResultBase", L"OptionsChanged");
            }

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

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

    static PyMethodDef _methods_IStorageQueryResultBase[] = {
        { "apply_new_query_options", reinterpret_cast<PyCFunction>(IStorageQueryResultBase_ApplyNewQueryOptions), METH_VARARGS, nullptr },
        { "find_start_index_async", reinterpret_cast<PyCFunction>(IStorageQueryResultBase_FindStartIndexAsync), METH_VARARGS, nullptr },
        { "get_current_query_options", reinterpret_cast<PyCFunction>(IStorageQueryResultBase_GetCurrentQueryOptions), METH_VARARGS, nullptr },
        { "get_item_count_async", reinterpret_cast<PyCFunction>(IStorageQueryResultBase_GetItemCountAsync), METH_VARARGS, nullptr },
        { "add_contents_changed", reinterpret_cast<PyCFunction>(IStorageQueryResultBase_add_ContentsChanged), METH_O, nullptr },
        { "remove_contents_changed", reinterpret_cast<PyCFunction>(IStorageQueryResultBase_remove_ContentsChanged), METH_O, nullptr },
        { "add_options_changed", reinterpret_cast<PyCFunction>(IStorageQueryResultBase_add_OptionsChanged), METH_O, nullptr },
        { "remove_options_changed", reinterpret_cast<PyCFunction>(IStorageQueryResultBase_remove_OptionsChanged), METH_O, nullptr },
        { }};

    static PyGetSetDef _getset_IStorageQueryResultBase[] = {
        { "folder", reinterpret_cast<getter>(IStorageQueryResultBase_get_Folder), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_IStorageQueryResultBase[] = {
        #if PY_VERSION_HEX < 0x030A0000
        { Py_tp_new, reinterpret_cast<void*>(_new_IStorageQueryResultBase) },
        #endif
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IStorageQueryResultBase) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IStorageQueryResultBase) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IStorageQueryResultBase) },
        { }};

    static PyType_Spec type_spec_IStorageQueryResultBase = {
        "winrt._winrt_windows_storage_search._IStorageQueryResultBase",
        sizeof(py::wrapper::Windows::Storage::Search::IStorageQueryResultBase),
        0,
        Py_TPFLAGS_DEFAULT
        #if PY_VERSION_HEX >= 0x030A0000
        | Py_TPFLAGS_DISALLOW_INSTANTIATION
        #endif
        ,
        _type_slots_IStorageQueryResultBase};

    struct ImplementsIStorageQueryResultBase : py::ImplementsInterfaceT<ImplementsIStorageQueryResultBase, winrt::Windows::Storage::Search::IStorageQueryResultBase>
    {
        ImplementsIStorageQueryResultBase() = delete;
        ImplementsIStorageQueryResultBase(PyObject* py_obj, winrt::impl::inspectable_abi* runtime_class) : py::ImplementsInterfaceT<ImplementsIStorageQueryResultBase, winrt::Windows::Storage::Search::IStorageQueryResultBase>(py_obj, runtime_class)
        {
        }

        auto ApplyNewQueryOptions(winrt::Windows::Storage::Search::QueryOptions const& param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

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

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

        auto FindStartIndexAsync(winrt::Windows::Foundation::IInspectable const& param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

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

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

                return py::convert_to<winrt::Windows::Foundation::IAsyncOperation<uint32_t>>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

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

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

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

                return py::convert_to<winrt::Windows::Storage::Search::QueryOptions>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

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

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

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

                return py::convert_to<winrt::Windows::Foundation::IAsyncOperation<uint32_t>>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

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

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

                return py::convert_to<winrt::Windows::Storage::StorageFolder>(value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto ContentsChanged(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Storage::Search::IStorageQueryResultBase, winrt::Windows::Foundation::IInspectable> const& param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

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

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

                return py::convert_to<winrt::event_token>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto ContentsChanged(winrt::event_token param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

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

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

        auto OptionsChanged(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Storage::Search::IStorageQueryResultBase, winrt::Windows::Foundation::IInspectable> const& param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

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

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

                return py::convert_to<winrt::event_token>(return_value.get());
            }
            catch (python_exception)
            {
                py::write_unraisable_and_throw();
            }
        }

        auto OptionsChanged(winrt::event_token param0)
        {
            try
            {
                py::pyobj_handle self{this->get_py_obj()};

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

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

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

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

    static PyObject* _from_IStorageQueryResultBase(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::Storage::Search::IStorageQueryResultBase>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _guid_ImplementsIStorageQueryResultBase(PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::guid_of<winrt::Windows::Storage::Search::IStorageQueryResultBase>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

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

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

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

    static PyMethodDef methods_ImplementsIStorageQueryResultBase[] = {
        { "_assign_array_", _assign_array_IStorageQueryResultBase, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_IStorageQueryResultBase), METH_O | METH_STATIC, nullptr },
        { "_guid_", reinterpret_cast<PyCFunction>(_guid_ImplementsIStorageQueryResultBase), METH_NOARGS | METH_STATIC, nullptr },
        { "_make_", reinterpret_cast<PyCFunction>(_make_ImplementsIStorageQueryResultBase), METH_VARARGS | METH_STATIC, nullptr },
        { }};

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

    static PyType_Spec type_spec_ImplementsIStorageQueryResultBase = {
        "winrt._winrt_windows_storage_search.IStorageQueryResultBase",
        0,
        0,
        Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE
        #if PY_VERSION_HEX >= 0x030A0000
        | Py_TPFLAGS_DISALLOW_INSTANTIATION
        #endif
        ,
        type_slots_ImplementsIStorageQueryResultBase};

    // ----- SortEntry struct --------------------

    winrt::Windows::Storage::Search::SortEntry SortEntry_from_tuple(PyObject* tuple)
    {
        if (PyTuple_GET_SIZE(tuple) != 2)
        {
            PyErr_SetString(PyExc_TypeError, "Incorrect number of fields");
            throw python_exception();
        }

        winrt::Windows::Storage::Search::SortEntry result{};

        result.PropertyName = py::convert_to<winrt::hstring>(tuple, 0);
        result.AscendingOrder = py::convert_to<bool>(tuple, 1);

        return result;
    }

    PyObject* _new_SortEntry(PyTypeObject* subclass, PyObject* args, PyObject* kwds) noexcept
    {
        pyobj_handle self_obj{(subclass->tp_alloc(subclass, 0))};
        if (!self_obj)
        {
            return nullptr;
        }

        auto self = reinterpret_cast<winrt_struct_wrapper<winrt::Windows::Storage::Search::SortEntry>*>(self_obj.get());
        std::construct_at(&self->obj);

        auto tuple_size = PyTuple_GET_SIZE(args);
        if ((tuple_size == 0) && (!kwds))
        {
            return self_obj.detach();
        }

        PyObject* _PropertyName{};
        int _AscendingOrder{};

        static const char* kwlist[] = {"property_name", "ascending_order", nullptr};
        if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Op", const_cast<char**>(kwlist), &_PropertyName, &_AscendingOrder))
        {
            return nullptr;
        }

        try
        {
            self->obj.PropertyName = _PropertyName ? py::convert_to<winrt::hstring>(_PropertyName) : winrt::hstring{};
            self->obj.AscendingOrder = _AscendingOrder;

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

    static void _dealloc_SortEntry(py::wrapper::Windows::Storage::Search::SortEntry* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

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

    PyObject* _replace_SortEntry(py::wrapper::Windows::Storage::Search::SortEntry* self, PyObject* args, PyObject* kwds) noexcept
    {
        try
        {
            PyObject* _PropertyName{};
            int _AscendingOrder{self->obj.AscendingOrder};

            static const char* kwlist[] = {"property_name", "ascending_order", nullptr};
            if (!PyArg_ParseTupleAndKeywords(args, kwds, "|$Op", const_cast<char**>(kwlist), &_PropertyName, &_AscendingOrder))
            {
                return nullptr;
            }

            auto copy = self->obj;
            copy.PropertyName = _PropertyName ? py::convert_to<winrt::hstring>(_PropertyName) : self->obj.PropertyName;
            copy.AscendingOrder = _AscendingOrder;

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

    PyObject* unpack_SortEntry(py::wrapper::Windows::Storage::Search::SortEntry* self, PyObject* /*unused*/) noexcept
    {
        py::pyobj_handle PropertyName{convert(self->obj.PropertyName)};
        if (!PropertyName)
        {
            return nullptr;
        }

        py::pyobj_handle AscendingOrder{convert(self->obj.AscendingOrder)};
        if (!AscendingOrder)
        {
            return nullptr;
        }

        pyobj_handle tuple{PyTuple_New(2)};
        if (!tuple)
        {
            return nullptr;
        }

        PyTuple_SET_ITEM(tuple.get(), 0, PropertyName.detach());
        PyTuple_SET_ITEM(tuple.get(), 1, AscendingOrder.detach());

        return tuple.detach();
    }

    static PyMethodDef _methods_SortEntry[] = {
        { "_assign_array_", _assign_array_SortEntry, METH_O | METH_STATIC, nullptr },
        { "__replace__", reinterpret_cast<PyCFunction>(reinterpret_cast<void*>(_replace_SortEntry)), METH_VARARGS | METH_KEYWORDS, nullptr },
        { "unpack", reinterpret_cast<PyCFunction>(unpack_SortEntry), METH_NOARGS, nullptr },
        { }};

    static PyObject* SortEntry_get_PropertyName(py::wrapper::Windows::Storage::Search::SortEntry* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.PropertyName);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* SortEntry_get_AscendingOrder(py::wrapper::Windows::Storage::Search::SortEntry* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.AscendingOrder);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyGetSetDef _getset_SortEntry[] = {
        { "property_name", reinterpret_cast<getter>(SortEntry_get_PropertyName), nullptr, nullptr, nullptr },
        { "ascending_order", reinterpret_cast<getter>(SortEntry_get_AscendingOrder), nullptr, nullptr, nullptr },
        { }};

    static PyObject* _richcompare_SortEntry(py::wrapper::Windows::Storage::Search::SortEntry* self, PyObject* other, int op) noexcept
    {
        try
        {
            auto _other = py::convert_to<winrt::Windows::Storage::Search::SortEntry>(other);

            if (op == Py_EQ)
            {
                if (self->obj == _other)
                {
                    Py_RETURN_TRUE;
                }

                Py_RETURN_FALSE;
            }

            if (op == Py_NE)
            {
                if (self->obj != _other)
                {
                    Py_RETURN_TRUE;
                }

                Py_RETURN_FALSE;
            }

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

    static PyObject* _repr_SortEntry(PyObject* self) noexcept
    {
        py::pyobj_handle PropertyName{PyObject_GetAttrString(self, "property_name")};
        if (!PropertyName)
        {
            return nullptr;
        }

        py::pyobj_handle AscendingOrder{PyObject_GetAttrString(self, "ascending_order")};
        if (!AscendingOrder)
        {
            return nullptr;
        }

        return PyUnicode_FromFormat("SortEntry(property_name=%R, ascending_order=%R)", PropertyName.get(), AscendingOrder.get());
    }

    static PyType_Slot _type_slots_SortEntry[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_SortEntry) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SortEntry) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SortEntry) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SortEntry) },
        { Py_tp_richcompare, reinterpret_cast<void*>(_richcompare_SortEntry) },
        { Py_tp_repr, reinterpret_cast<void*>(_repr_SortEntry) },
        { }};

    static PyType_Spec type_spec_SortEntry = {
        "winrt._winrt_windows_storage_search.SortEntry",
        sizeof(py::wrapper::Windows::Storage::Search::SortEntry),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SortEntry};

    // ----- Windows.Storage.Search Initialization --------------------

    PyDoc_STRVAR(module_doc, "Windows.Storage.Search");

    static PyModuleDef module_def = {
        PyModuleDef_HEAD_INIT,
        "_winrt_windows_storage_search",
        module_doc,
        0,
        nullptr,
        nullptr,
        nullptr,
        nullptr,
        nullptr};
} // py::cpp::Windows::Storage::Search

PyMODINIT_FUNC PyInit__winrt_windows_storage_search(void) noexcept
{
    using namespace py::cpp::Windows::Storage::Search;

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

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

    if (!module)
    {
        return nullptr;
    }

    auto inspectable_meta_type = py::get_inspectable_meta_type();
    if (!inspectable_meta_type)
    {
        return nullptr;
    }

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

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

    if (!object_bases)
    {
        return nullptr;
    }

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

    py::pyobj_handle type_ContentIndexer_Static{PyType_FromSpecWithBases(&type_spec_ContentIndexer_Static, ContentIndexer_Static_bases.get())};
    if (!type_ContentIndexer_Static)
    {
        return nullptr;
    }

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

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

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

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

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

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

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

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

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

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

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

    py::pytype_handle IIndexableContent_type{py::register_python_type(module.get(), &type_spec_IIndexableContent, object_bases.get(), nullptr)};
    if (!IIndexableContent_type)
    {
        return nullptr;
    }

    py::pytype_handle ImplementsIIndexableContent_type{py::register_python_type(module.get(), &type_spec_ImplementsIIndexableContent, nullptr, inspectable_meta_type)};
    if (!ImplementsIIndexableContent_type)
    {
        return nullptr;
    }

    if (PyModule_AddType(module.get(), ImplementsIIndexableContent_type.get()) == -1)
    {
        return nullptr;
    }

    py::pytype_handle IStorageFolderQueryOperations_type{py::register_python_type(module.get(), &type_spec_IStorageFolderQueryOperations, object_bases.get(), nullptr)};
    if (!IStorageFolderQueryOperations_type)
    {
        return nullptr;
    }

    py::pytype_handle ImplementsIStorageFolderQueryOperations_type{py::register_python_type(module.get(), &type_spec_ImplementsIStorageFolderQueryOperations, nullptr, inspectable_meta_type)};
    if (!ImplementsIStorageFolderQueryOperations_type)
    {
        return nullptr;
    }

    if (PyModule_AddType(module.get(), ImplementsIStorageFolderQueryOperations_type.get()) == -1)
    {
        return nullptr;
    }

    py::pytype_handle IStorageQueryResultBase_type{py::register_python_type(module.get(), &type_spec_IStorageQueryResultBase, object_bases.get(), nullptr)};
    if (!IStorageQueryResultBase_type)
    {
        return nullptr;
    }

    py::pytype_handle ImplementsIStorageQueryResultBase_type{py::register_python_type(module.get(), &type_spec_ImplementsIStorageQueryResultBase, nullptr, inspectable_meta_type)};
    if (!ImplementsIStorageQueryResultBase_type)
    {
        return nullptr;
    }

    if (PyModule_AddType(module.get(), ImplementsIStorageQueryResultBase_type.get()) == -1)
    {
        return nullptr;
    }

    py::pytype_handle SortEntry_type{py::register_python_type(module.get(), &type_spec_SortEntry, nullptr, nullptr)};
    if (!SortEntry_type)
    {
        return nullptr;
    }

    py::pyobj_handle SortEntry_from_tuple_capsule{PyCapsule_New(reinterpret_cast<void*>(SortEntry_from_tuple),"winrt._winrt_windows_storage_search.SortEntry_from_tuple", nullptr)};
    if (!SortEntry_from_tuple_capsule)
    {
        return nullptr;
    }

    if (PyModule_AddObjectRef(module.get(), "SortEntry_from_tuple", SortEntry_from_tuple_capsule.get()) == -1)
    {
        return nullptr;
    }

    return module.detach();
}
