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

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

namespace py::cpp::Windows::Storage::Pickers
{
    // ----- FileExtensionVector class --------------------

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

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

    static PyObject* FileExtensionVector_Append(py::wrapper::Windows::Storage::Pickers::FileExtensionVector* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileExtensionVector", L"Append", 1);
                }

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

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

                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* FileExtensionVector_Clear(py::wrapper::Windows::Storage::Pickers::FileExtensionVector* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileExtensionVector", L"Clear", 0);
                }

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

                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* FileExtensionVector_First(py::wrapper::Windows::Storage::Pickers::FileExtensionVector* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileExtensionVector", L"First", 0);
                }

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

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

    static PyObject* FileExtensionVector_GetAt(py::wrapper::Windows::Storage::Pickers::FileExtensionVector* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileExtensionVector", 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(self->obj.GetAt(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* FileExtensionVector_GetMany(py::wrapper::Windows::Storage::Pickers::FileExtensionVector* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileExtensionVector", 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::hstring, true>>(args, 1);

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

    static PyObject* FileExtensionVector_GetView(py::wrapper::Windows::Storage::Pickers::FileExtensionVector* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileExtensionVector", L"GetView", 0);
                }

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

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

    static PyObject* FileExtensionVector_IndexOf(py::wrapper::Windows::Storage::Pickers::FileExtensionVector* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileExtensionVector", L"IndexOf", 1);
                }

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

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

                auto return_value = 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* FileExtensionVector_InsertAt(py::wrapper::Windows::Storage::Pickers::FileExtensionVector* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileExtensionVector", 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::hstring>(args, 1);

                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* FileExtensionVector_RemoveAt(py::wrapper::Windows::Storage::Pickers::FileExtensionVector* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileExtensionVector", 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);

                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* FileExtensionVector_RemoveAtEnd(py::wrapper::Windows::Storage::Pickers::FileExtensionVector* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileExtensionVector", L"RemoveAtEnd", 0);
                }

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

                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* FileExtensionVector_ReplaceAll(py::wrapper::Windows::Storage::Pickers::FileExtensionVector* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileExtensionVector", 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::hstring, false>>(args, 0);

                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* FileExtensionVector_SetAt(py::wrapper::Windows::Storage::Pickers::FileExtensionVector* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileExtensionVector", 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::hstring>(args, 1);

                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* FileExtensionVector_get_Size(py::wrapper::Windows::Storage::Pickers::FileExtensionVector* 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.Pickers.FileExtensionVector", 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(self->obj.Size());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_FileExtensionVector(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::Pickers::FileExtensionVector>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _iterator_FileExtensionVector(py::wrapper::Windows::Storage::Pickers::FileExtensionVector* self) noexcept
    {
        try
        {
            return py::convert(self->obj.First());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static Py_ssize_t _seq_length_FileExtensionVector(py::wrapper::Windows::Storage::Pickers::FileExtensionVector* self) noexcept
    {
        try
        {
            return static_cast<Py_ssize_t>(self->obj.Size());
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* _seq_item_FileExtensionVector(py::wrapper::Windows::Storage::Pickers::FileExtensionVector* self, Py_ssize_t i) noexcept
    {
        try
        {
            return py::convert(self->obj.GetAt(static_cast<uint32_t>(i)));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _seq_subscript_FileExtensionVector(py::wrapper::Windows::Storage::Pickers::FileExtensionVector* 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_FileExtensionVector(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;

            if (PySlice_GetIndicesEx(slice, self->obj.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::hstring> items(static_cast<uint32_t>(length), empty_instance<winrt::hstring>::get());

            auto count = 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_FileExtensionVector(py::wrapper::Windows::Storage::Pickers::FileExtensionVector* self, Py_ssize_t i, PyObject* value) noexcept
    {
        try
        {
            if (!value)
            {
                self->obj.RemoveAt(static_cast<uint32_t>(i));
            }
            else
            {
                self->obj.SetAt(static_cast<uint32_t>(i), py::convert_to<winrt::hstring>(value));
            }

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

    static PyMethodDef _methods_FileExtensionVector[] = {
        { "append", reinterpret_cast<PyCFunction>(FileExtensionVector_Append), METH_VARARGS, nullptr },
        { "clear", reinterpret_cast<PyCFunction>(FileExtensionVector_Clear), METH_VARARGS, nullptr },
        { "first", reinterpret_cast<PyCFunction>(FileExtensionVector_First), METH_VARARGS, nullptr },
        { "get_at", reinterpret_cast<PyCFunction>(FileExtensionVector_GetAt), METH_VARARGS, nullptr },
        { "get_many", reinterpret_cast<PyCFunction>(FileExtensionVector_GetMany), METH_VARARGS, nullptr },
        { "get_view", reinterpret_cast<PyCFunction>(FileExtensionVector_GetView), METH_VARARGS, nullptr },
        { "index_of", reinterpret_cast<PyCFunction>(FileExtensionVector_IndexOf), METH_VARARGS, nullptr },
        { "insert_at", reinterpret_cast<PyCFunction>(FileExtensionVector_InsertAt), METH_VARARGS, nullptr },
        { "remove_at", reinterpret_cast<PyCFunction>(FileExtensionVector_RemoveAt), METH_VARARGS, nullptr },
        { "remove_at_end", reinterpret_cast<PyCFunction>(FileExtensionVector_RemoveAtEnd), METH_VARARGS, nullptr },
        { "replace_all", reinterpret_cast<PyCFunction>(FileExtensionVector_ReplaceAll), METH_VARARGS, nullptr },
        { "set_at", reinterpret_cast<PyCFunction>(FileExtensionVector_SetAt), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_FileExtensionVector, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_FileExtensionVector), METH_O | METH_STATIC, nullptr },
        { }
    };

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

    static PyType_Slot _type_slots_FileExtensionVector[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_FileExtensionVector) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_FileExtensionVector) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_FileExtensionVector) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_FileExtensionVector) },
        { Py_tp_iter, reinterpret_cast<void*>(_iterator_FileExtensionVector) },
        { Py_sq_length, reinterpret_cast<void*>(_seq_length_FileExtensionVector) },
        { Py_sq_item, reinterpret_cast<void*>(_seq_item_FileExtensionVector) },
        { Py_mp_subscript, reinterpret_cast<void*>(_seq_subscript_FileExtensionVector) },
        { Py_sq_ass_item, reinterpret_cast<void*>(_seq_assign_FileExtensionVector) },
        { }
    };

    static PyType_Spec type_spec_FileExtensionVector = {
        "winrt._winrt_windows_storage_pickers.FileExtensionVector",
        sizeof(py::wrapper::Windows::Storage::Pickers::FileExtensionVector),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_FileExtensionVector};

    // ----- FileOpenPicker class --------------------

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

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

    static PyObject* FileOpenPicker_CreateForUser(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileOpenPicker", L"CreateForUser", 1);
                }

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

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

                return py::convert(winrt::Windows::Storage::Pickers::FileOpenPicker::CreateForUser(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* FileOpenPicker_PickMultipleFilesAndContinue(py::wrapper::Windows::Storage::Pickers::FileOpenPicker* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileOpenPicker", L"PickMultipleFilesAndContinue", 0);
                }

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

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

    static PyObject* FileOpenPicker_PickMultipleFilesAsync(py::wrapper::Windows::Storage::Pickers::FileOpenPicker* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileOpenPicker", L"PickMultipleFilesAsync", 0);
                }

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

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

    static PyObject* FileOpenPicker_PickSingleFileAndContinue(py::wrapper::Windows::Storage::Pickers::FileOpenPicker* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileOpenPicker", L"PickSingleFileAndContinue", 0);
                }

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

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

    static PyObject* FileOpenPicker_PickSingleFileAsync(py::wrapper::Windows::Storage::Pickers::FileOpenPicker* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileOpenPicker", L"PickSingleFileAsync", 0);
                }

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

                return py::convert(self->obj.PickSingleFileAsync());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else 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.Pickers.FileOpenPicker", L"PickSingleFileAsync", 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(self->obj.PickSingleFileAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* FileOpenPicker_ResumePickSingleFileAsync(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileOpenPicker", L"ResumePickSingleFileAsync", 0);
                }

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

                return py::convert(winrt::Windows::Storage::Pickers::FileOpenPicker::ResumePickSingleFileAsync());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* FileOpenPicker_get_ViewMode(py::wrapper::Windows::Storage::Pickers::FileOpenPicker* 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.Pickers.FileOpenPicker", L"ViewMode");
            }

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

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

    static int FileOpenPicker_put_ViewMode(py::wrapper::Windows::Storage::Pickers::FileOpenPicker* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            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.Pickers.FileOpenPicker", L"ViewMode");
            }

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

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

    static PyObject* FileOpenPicker_get_SuggestedStartLocation(py::wrapper::Windows::Storage::Pickers::FileOpenPicker* 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.Pickers.FileOpenPicker", L"SuggestedStartLocation");
            }

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

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

    static int FileOpenPicker_put_SuggestedStartLocation(py::wrapper::Windows::Storage::Pickers::FileOpenPicker* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            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.Pickers.FileOpenPicker", L"SuggestedStartLocation");
            }

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

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

    static PyObject* FileOpenPicker_get_SettingsIdentifier(py::wrapper::Windows::Storage::Pickers::FileOpenPicker* 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.Pickers.FileOpenPicker", L"SettingsIdentifier");
            }

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

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

    static int FileOpenPicker_put_SettingsIdentifier(py::wrapper::Windows::Storage::Pickers::FileOpenPicker* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            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.Pickers.FileOpenPicker", L"SettingsIdentifier");
            }

            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);

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

    static PyObject* FileOpenPicker_get_CommitButtonText(py::wrapper::Windows::Storage::Pickers::FileOpenPicker* 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.Pickers.FileOpenPicker", L"CommitButtonText");
            }

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

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

    static int FileOpenPicker_put_CommitButtonText(py::wrapper::Windows::Storage::Pickers::FileOpenPicker* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            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.Pickers.FileOpenPicker", L"CommitButtonText");
            }

            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);

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

    static PyObject* FileOpenPicker_get_FileTypeFilter(py::wrapper::Windows::Storage::Pickers::FileOpenPicker* 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.Pickers.FileOpenPicker", 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(self->obj.FileTypeFilter());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* FileOpenPicker_get_ContinuationData(py::wrapper::Windows::Storage::Pickers::FileOpenPicker* 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.Pickers.FileOpenPicker", L"ContinuationData");
            }

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

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

    static PyObject* FileOpenPicker_get_User(py::wrapper::Windows::Storage::Pickers::FileOpenPicker* 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.Pickers.FileOpenPicker", L"User");
            }

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

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

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

    static PyObject* _from_FileOpenPicker(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::Pickers::FileOpenPicker>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_FileOpenPicker[] = {
        { "pick_multiple_files_and_continue", reinterpret_cast<PyCFunction>(FileOpenPicker_PickMultipleFilesAndContinue), METH_VARARGS, nullptr },
        { "pick_multiple_files_async", reinterpret_cast<PyCFunction>(FileOpenPicker_PickMultipleFilesAsync), METH_VARARGS, nullptr },
        { "pick_single_file_and_continue", reinterpret_cast<PyCFunction>(FileOpenPicker_PickSingleFileAndContinue), METH_VARARGS, nullptr },
        { "pick_single_file_async", reinterpret_cast<PyCFunction>(FileOpenPicker_PickSingleFileAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_FileOpenPicker, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_FileOpenPicker), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_FileOpenPicker[] = {
        { "view_mode", reinterpret_cast<getter>(FileOpenPicker_get_ViewMode), reinterpret_cast<setter>(FileOpenPicker_put_ViewMode), nullptr, nullptr },
        { "suggested_start_location", reinterpret_cast<getter>(FileOpenPicker_get_SuggestedStartLocation), reinterpret_cast<setter>(FileOpenPicker_put_SuggestedStartLocation), nullptr, nullptr },
        { "settings_identifier", reinterpret_cast<getter>(FileOpenPicker_get_SettingsIdentifier), reinterpret_cast<setter>(FileOpenPicker_put_SettingsIdentifier), nullptr, nullptr },
        { "commit_button_text", reinterpret_cast<getter>(FileOpenPicker_get_CommitButtonText), reinterpret_cast<setter>(FileOpenPicker_put_CommitButtonText), nullptr, nullptr },
        { "file_type_filter", reinterpret_cast<getter>(FileOpenPicker_get_FileTypeFilter), nullptr, nullptr, nullptr },
        { "continuation_data", reinterpret_cast<getter>(FileOpenPicker_get_ContinuationData), nullptr, nullptr, nullptr },
        { "user", reinterpret_cast<getter>(FileOpenPicker_get_User), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_FileOpenPicker[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_FileOpenPicker) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_FileOpenPicker) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_FileOpenPicker) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_FileOpenPicker) },
        { }
    };

    static PyType_Spec type_spec_FileOpenPicker = {
        "winrt._winrt_windows_storage_pickers.FileOpenPicker",
        sizeof(py::wrapper::Windows::Storage::Pickers::FileOpenPicker),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_FileOpenPicker};

    static PyGetSetDef getset_FileOpenPicker_Static[] = {
        { }
    };

    static PyMethodDef methods_FileOpenPicker_Static[] = {
        { "create_for_user", reinterpret_cast<PyCFunction>(FileOpenPicker_CreateForUser), METH_VARARGS, nullptr },
        { "resume_pick_single_file_async", reinterpret_cast<PyCFunction>(FileOpenPicker_ResumePickSingleFileAsync), METH_VARARGS, nullptr },
        { }
    };

    static PyType_Slot type_slots_FileOpenPicker_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_FileOpenPicker_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_FileOpenPicker_Static) },
        { }
    };

    static PyType_Spec type_spec_FileOpenPicker_Static =
    {
        "winrt._winrt_windows_storage_pickers.FileOpenPicker_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_FileOpenPicker_Static
    };

    // ----- FilePickerFileTypesOrderedMap class --------------------

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

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

    static PyObject* FilePickerFileTypesOrderedMap_Clear(py::wrapper::Windows::Storage::Pickers::FilePickerFileTypesOrderedMap* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FilePickerFileTypesOrderedMap", L"Clear", 0);
                }

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

                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* FilePickerFileTypesOrderedMap_First(py::wrapper::Windows::Storage::Pickers::FilePickerFileTypesOrderedMap* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FilePickerFileTypesOrderedMap", L"First", 0);
                }

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

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

    static PyObject* FilePickerFileTypesOrderedMap_GetView(py::wrapper::Windows::Storage::Pickers::FilePickerFileTypesOrderedMap* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FilePickerFileTypesOrderedMap", L"GetView", 0);
                }

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

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

    static PyObject* FilePickerFileTypesOrderedMap_HasKey(py::wrapper::Windows::Storage::Pickers::FilePickerFileTypesOrderedMap* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FilePickerFileTypesOrderedMap", L"HasKey", 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(self->obj.HasKey(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* FilePickerFileTypesOrderedMap_Insert(py::wrapper::Windows::Storage::Pickers::FilePickerFileTypesOrderedMap* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FilePickerFileTypesOrderedMap", L"Insert", 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::IVector<winrt::hstring>>(args, 1);

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

    static PyObject* FilePickerFileTypesOrderedMap_Lookup(py::wrapper::Windows::Storage::Pickers::FilePickerFileTypesOrderedMap* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FilePickerFileTypesOrderedMap", L"Lookup", 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(self->obj.Lookup(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* FilePickerFileTypesOrderedMap_Remove(py::wrapper::Windows::Storage::Pickers::FilePickerFileTypesOrderedMap* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FilePickerFileTypesOrderedMap", L"Remove", 1);
                }

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

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

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

    static PyObject* FilePickerFileTypesOrderedMap_get_Size(py::wrapper::Windows::Storage::Pickers::FilePickerFileTypesOrderedMap* 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.Pickers.FilePickerFileTypesOrderedMap", 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(self->obj.Size());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_FilePickerFileTypesOrderedMap(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::Pickers::FilePickerFileTypesOrderedMap>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _iterator_FilePickerFileTypesOrderedMap(py::wrapper::Windows::Storage::Pickers::FilePickerFileTypesOrderedMap* self) noexcept
    {
        try
        {
            py::pyobj_handle iter{py::convert(self->obj.First())};

            if (!iter)
            {
                return nullptr;
            }

            return py::wrap_mapping_iter(iter.get());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int _map_contains_FilePickerFileTypesOrderedMap(py::wrapper::Windows::Storage::Pickers::FilePickerFileTypesOrderedMap* self, PyObject* key) noexcept
    {
        try
        {
            return static_cast<int>(self->obj.HasKey(py::convert_to<winrt::hstring>(key)));
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static Py_ssize_t _map_length_FilePickerFileTypesOrderedMap(py::wrapper::Windows::Storage::Pickers::FilePickerFileTypesOrderedMap* self) noexcept
    {
        try
        {
            return static_cast<Py_ssize_t>(self->obj.Size());
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* _map_subscript_FilePickerFileTypesOrderedMap(py::wrapper::Windows::Storage::Pickers::FilePickerFileTypesOrderedMap* self, PyObject* key) noexcept
    {
        try
        {
            auto _key = py::convert_to<winrt::hstring>(key);
            auto value = self->obj.TryLookup(_key);

            if (!value) {
                if constexpr (std::is_base_of_v<winrt::Windows::Foundation::IUnknown, decltype(value)>)
                {
                    if (self->obj.HasKey(_key))
                    {
                        Py_RETURN_NONE;
                    }
                }

                PyErr_SetObject(PyExc_KeyError, key);
                return nullptr;
            }

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

    static int _map_assign_FilePickerFileTypesOrderedMap(py::wrapper::Windows::Storage::Pickers::FilePickerFileTypesOrderedMap* self, PyObject* key, PyObject* value) noexcept
    {
        try
        {
            auto _key = py::convert_to<winrt::hstring>(key);

            if (value == nullptr) {
                if (!self->obj.TryRemove(_key)) {
                    PyErr_SetObject(PyExc_KeyError, key);
                    return -1;
                }

                return 0;
            }

            self->obj.Insert(_key, py::convert_to<winrt::Windows::Foundation::Collections::IVector<winrt::hstring>>(value));

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

    static PyMethodDef _methods_FilePickerFileTypesOrderedMap[] = {
        { "clear", reinterpret_cast<PyCFunction>(FilePickerFileTypesOrderedMap_Clear), METH_VARARGS, nullptr },
        { "first", reinterpret_cast<PyCFunction>(FilePickerFileTypesOrderedMap_First), METH_VARARGS, nullptr },
        { "get_view", reinterpret_cast<PyCFunction>(FilePickerFileTypesOrderedMap_GetView), METH_VARARGS, nullptr },
        { "has_key", reinterpret_cast<PyCFunction>(FilePickerFileTypesOrderedMap_HasKey), METH_VARARGS, nullptr },
        { "insert", reinterpret_cast<PyCFunction>(FilePickerFileTypesOrderedMap_Insert), METH_VARARGS, nullptr },
        { "lookup", reinterpret_cast<PyCFunction>(FilePickerFileTypesOrderedMap_Lookup), METH_VARARGS, nullptr },
        { "remove", reinterpret_cast<PyCFunction>(FilePickerFileTypesOrderedMap_Remove), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_FilePickerFileTypesOrderedMap, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_FilePickerFileTypesOrderedMap), METH_O | METH_STATIC, nullptr },
        { }
    };

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

    static PyType_Slot _type_slots_FilePickerFileTypesOrderedMap[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_FilePickerFileTypesOrderedMap) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_FilePickerFileTypesOrderedMap) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_FilePickerFileTypesOrderedMap) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_FilePickerFileTypesOrderedMap) },
        { Py_tp_iter, reinterpret_cast<void*>(_iterator_FilePickerFileTypesOrderedMap) },
        { Py_sq_contains, reinterpret_cast<void*>(_map_contains_FilePickerFileTypesOrderedMap) },
        { Py_mp_length, reinterpret_cast<void*>(_map_length_FilePickerFileTypesOrderedMap) },
        { Py_mp_subscript, reinterpret_cast<void*>(_map_subscript_FilePickerFileTypesOrderedMap) },
        { Py_mp_ass_subscript, reinterpret_cast<void*>(_map_assign_FilePickerFileTypesOrderedMap) },
        { }
    };

    static PyType_Spec type_spec_FilePickerFileTypesOrderedMap = {
        "winrt._winrt_windows_storage_pickers.FilePickerFileTypesOrderedMap",
        sizeof(py::wrapper::Windows::Storage::Pickers::FilePickerFileTypesOrderedMap),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_FilePickerFileTypesOrderedMap};

    // ----- FilePickerSelectedFilesArray class --------------------

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

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

    static PyObject* FilePickerSelectedFilesArray_First(py::wrapper::Windows::Storage::Pickers::FilePickerSelectedFilesArray* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FilePickerSelectedFilesArray", L"First", 0);
                }

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

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

    static PyObject* FilePickerSelectedFilesArray_GetAt(py::wrapper::Windows::Storage::Pickers::FilePickerSelectedFilesArray* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FilePickerSelectedFilesArray", 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(self->obj.GetAt(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* FilePickerSelectedFilesArray_GetMany(py::wrapper::Windows::Storage::Pickers::FilePickerSelectedFilesArray* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FilePickerSelectedFilesArray", 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::StorageFile, true>>(args, 1);

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

    static PyObject* FilePickerSelectedFilesArray_IndexOf(py::wrapper::Windows::Storage::Pickers::FilePickerSelectedFilesArray* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FilePickerSelectedFilesArray", 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::StorageFile>(args, 0);
                uint32_t param1{};

                auto return_value = 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* FilePickerSelectedFilesArray_get_Size(py::wrapper::Windows::Storage::Pickers::FilePickerSelectedFilesArray* 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.Pickers.FilePickerSelectedFilesArray", 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(self->obj.Size());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_FilePickerSelectedFilesArray(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::Pickers::FilePickerSelectedFilesArray>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _iterator_FilePickerSelectedFilesArray(py::wrapper::Windows::Storage::Pickers::FilePickerSelectedFilesArray* self) noexcept
    {
        try
        {
            return py::convert(self->obj.First());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static Py_ssize_t _seq_length_FilePickerSelectedFilesArray(py::wrapper::Windows::Storage::Pickers::FilePickerSelectedFilesArray* self) noexcept
    {
        try
        {
            return static_cast<Py_ssize_t>(self->obj.Size());
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* _seq_item_FilePickerSelectedFilesArray(py::wrapper::Windows::Storage::Pickers::FilePickerSelectedFilesArray* self, Py_ssize_t i) noexcept
    {
        try
        {
            return py::convert(self->obj.GetAt(static_cast<uint32_t>(i)));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _seq_subscript_FilePickerSelectedFilesArray(py::wrapper::Windows::Storage::Pickers::FilePickerSelectedFilesArray* 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_FilePickerSelectedFilesArray(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;

            if (PySlice_GetIndicesEx(slice, self->obj.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::StorageFile> items(static_cast<uint32_t>(length), empty_instance<winrt::Windows::Storage::StorageFile>::get());

            auto count = 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 PyMethodDef _methods_FilePickerSelectedFilesArray[] = {
        { "first", reinterpret_cast<PyCFunction>(FilePickerSelectedFilesArray_First), METH_VARARGS, nullptr },
        { "get_at", reinterpret_cast<PyCFunction>(FilePickerSelectedFilesArray_GetAt), METH_VARARGS, nullptr },
        { "get_many", reinterpret_cast<PyCFunction>(FilePickerSelectedFilesArray_GetMany), METH_VARARGS, nullptr },
        { "index_of", reinterpret_cast<PyCFunction>(FilePickerSelectedFilesArray_IndexOf), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_FilePickerSelectedFilesArray, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_FilePickerSelectedFilesArray), METH_O | METH_STATIC, nullptr },
        { }
    };

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

    static PyType_Slot _type_slots_FilePickerSelectedFilesArray[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_FilePickerSelectedFilesArray) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_FilePickerSelectedFilesArray) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_FilePickerSelectedFilesArray) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_FilePickerSelectedFilesArray) },
        { Py_tp_iter, reinterpret_cast<void*>(_iterator_FilePickerSelectedFilesArray) },
        { Py_sq_length, reinterpret_cast<void*>(_seq_length_FilePickerSelectedFilesArray) },
        { Py_sq_item, reinterpret_cast<void*>(_seq_item_FilePickerSelectedFilesArray) },
        { Py_mp_subscript, reinterpret_cast<void*>(_seq_subscript_FilePickerSelectedFilesArray) },
        { }
    };

    static PyType_Spec type_spec_FilePickerSelectedFilesArray = {
        "winrt._winrt_windows_storage_pickers.FilePickerSelectedFilesArray",
        sizeof(py::wrapper::Windows::Storage::Pickers::FilePickerSelectedFilesArray),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_FilePickerSelectedFilesArray};

    // ----- FileSavePicker class --------------------

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

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

    static PyObject* FileSavePicker_CreateForUser(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileSavePicker", L"CreateForUser", 1);
                }

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

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

                return py::convert(winrt::Windows::Storage::Pickers::FileSavePicker::CreateForUser(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* FileSavePicker_PickSaveFileAndContinue(py::wrapper::Windows::Storage::Pickers::FileSavePicker* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileSavePicker", L"PickSaveFileAndContinue", 0);
                }

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

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

    static PyObject* FileSavePicker_PickSaveFileAsync(py::wrapper::Windows::Storage::Pickers::FileSavePicker* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FileSavePicker", L"PickSaveFileAsync", 0);
                }

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

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

    static PyObject* FileSavePicker_get_SuggestedStartLocation(py::wrapper::Windows::Storage::Pickers::FileSavePicker* 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.Pickers.FileSavePicker", L"SuggestedStartLocation");
            }

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

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

    static int FileSavePicker_put_SuggestedStartLocation(py::wrapper::Windows::Storage::Pickers::FileSavePicker* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            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.Pickers.FileSavePicker", L"SuggestedStartLocation");
            }

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

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

    static PyObject* FileSavePicker_get_SuggestedSaveFile(py::wrapper::Windows::Storage::Pickers::FileSavePicker* 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.Pickers.FileSavePicker", L"SuggestedSaveFile");
            }

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

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

    static int FileSavePicker_put_SuggestedSaveFile(py::wrapper::Windows::Storage::Pickers::FileSavePicker* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            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.Pickers.FileSavePicker", L"SuggestedSaveFile");
            }

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

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

    static PyObject* FileSavePicker_get_SuggestedFileName(py::wrapper::Windows::Storage::Pickers::FileSavePicker* 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.Pickers.FileSavePicker", L"SuggestedFileName");
            }

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

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

    static int FileSavePicker_put_SuggestedFileName(py::wrapper::Windows::Storage::Pickers::FileSavePicker* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            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.Pickers.FileSavePicker", L"SuggestedFileName");
            }

            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);

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

    static PyObject* FileSavePicker_get_SettingsIdentifier(py::wrapper::Windows::Storage::Pickers::FileSavePicker* 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.Pickers.FileSavePicker", L"SettingsIdentifier");
            }

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

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

    static int FileSavePicker_put_SettingsIdentifier(py::wrapper::Windows::Storage::Pickers::FileSavePicker* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            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.Pickers.FileSavePicker", L"SettingsIdentifier");
            }

            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);

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

    static PyObject* FileSavePicker_get_DefaultFileExtension(py::wrapper::Windows::Storage::Pickers::FileSavePicker* 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.Pickers.FileSavePicker", L"DefaultFileExtension");
            }

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

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

    static int FileSavePicker_put_DefaultFileExtension(py::wrapper::Windows::Storage::Pickers::FileSavePicker* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            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.Pickers.FileSavePicker", L"DefaultFileExtension");
            }

            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);

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

    static PyObject* FileSavePicker_get_CommitButtonText(py::wrapper::Windows::Storage::Pickers::FileSavePicker* 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.Pickers.FileSavePicker", L"CommitButtonText");
            }

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

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

    static int FileSavePicker_put_CommitButtonText(py::wrapper::Windows::Storage::Pickers::FileSavePicker* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            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.Pickers.FileSavePicker", L"CommitButtonText");
            }

            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);

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

    static PyObject* FileSavePicker_get_FileTypeChoices(py::wrapper::Windows::Storage::Pickers::FileSavePicker* 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.Pickers.FileSavePicker", L"FileTypeChoices");
            }

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

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

    static PyObject* FileSavePicker_get_ContinuationData(py::wrapper::Windows::Storage::Pickers::FileSavePicker* 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.Pickers.FileSavePicker", L"ContinuationData");
            }

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

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

    static PyObject* FileSavePicker_get_EnterpriseId(py::wrapper::Windows::Storage::Pickers::FileSavePicker* 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.Pickers.FileSavePicker", L"EnterpriseId");
            }

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

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

    static int FileSavePicker_put_EnterpriseId(py::wrapper::Windows::Storage::Pickers::FileSavePicker* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            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.Pickers.FileSavePicker", L"EnterpriseId");
            }

            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);

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

    static PyObject* FileSavePicker_get_User(py::wrapper::Windows::Storage::Pickers::FileSavePicker* 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.Pickers.FileSavePicker", L"User");
            }

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

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

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

    static PyObject* _from_FileSavePicker(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::Pickers::FileSavePicker>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_FileSavePicker[] = {
        { "pick_save_file_and_continue", reinterpret_cast<PyCFunction>(FileSavePicker_PickSaveFileAndContinue), METH_VARARGS, nullptr },
        { "pick_save_file_async", reinterpret_cast<PyCFunction>(FileSavePicker_PickSaveFileAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_FileSavePicker, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_FileSavePicker), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_FileSavePicker[] = {
        { "suggested_start_location", reinterpret_cast<getter>(FileSavePicker_get_SuggestedStartLocation), reinterpret_cast<setter>(FileSavePicker_put_SuggestedStartLocation), nullptr, nullptr },
        { "suggested_save_file", reinterpret_cast<getter>(FileSavePicker_get_SuggestedSaveFile), reinterpret_cast<setter>(FileSavePicker_put_SuggestedSaveFile), nullptr, nullptr },
        { "suggested_file_name", reinterpret_cast<getter>(FileSavePicker_get_SuggestedFileName), reinterpret_cast<setter>(FileSavePicker_put_SuggestedFileName), nullptr, nullptr },
        { "settings_identifier", reinterpret_cast<getter>(FileSavePicker_get_SettingsIdentifier), reinterpret_cast<setter>(FileSavePicker_put_SettingsIdentifier), nullptr, nullptr },
        { "default_file_extension", reinterpret_cast<getter>(FileSavePicker_get_DefaultFileExtension), reinterpret_cast<setter>(FileSavePicker_put_DefaultFileExtension), nullptr, nullptr },
        { "commit_button_text", reinterpret_cast<getter>(FileSavePicker_get_CommitButtonText), reinterpret_cast<setter>(FileSavePicker_put_CommitButtonText), nullptr, nullptr },
        { "file_type_choices", reinterpret_cast<getter>(FileSavePicker_get_FileTypeChoices), nullptr, nullptr, nullptr },
        { "continuation_data", reinterpret_cast<getter>(FileSavePicker_get_ContinuationData), nullptr, nullptr, nullptr },
        { "enterprise_id", reinterpret_cast<getter>(FileSavePicker_get_EnterpriseId), reinterpret_cast<setter>(FileSavePicker_put_EnterpriseId), nullptr, nullptr },
        { "user", reinterpret_cast<getter>(FileSavePicker_get_User), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_FileSavePicker[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_FileSavePicker) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_FileSavePicker) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_FileSavePicker) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_FileSavePicker) },
        { }
    };

    static PyType_Spec type_spec_FileSavePicker = {
        "winrt._winrt_windows_storage_pickers.FileSavePicker",
        sizeof(py::wrapper::Windows::Storage::Pickers::FileSavePicker),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_FileSavePicker};

    static PyGetSetDef getset_FileSavePicker_Static[] = {
        { }
    };

    static PyMethodDef methods_FileSavePicker_Static[] = {
        { "create_for_user", reinterpret_cast<PyCFunction>(FileSavePicker_CreateForUser), METH_VARARGS, nullptr },
        { }
    };

    static PyType_Slot type_slots_FileSavePicker_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_FileSavePicker_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_FileSavePicker_Static) },
        { }
    };

    static PyType_Spec type_spec_FileSavePicker_Static =
    {
        "winrt._winrt_windows_storage_pickers.FileSavePicker_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_FileSavePicker_Static
    };

    // ----- FolderPicker class --------------------

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

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

    static PyObject* FolderPicker_CreateForUser(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FolderPicker", L"CreateForUser", 1);
                }

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

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

                return py::convert(winrt::Windows::Storage::Pickers::FolderPicker::CreateForUser(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* FolderPicker_PickFolderAndContinue(py::wrapper::Windows::Storage::Pickers::FolderPicker* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FolderPicker", L"PickFolderAndContinue", 0);
                }

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

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

    static PyObject* FolderPicker_PickSingleFolderAsync(py::wrapper::Windows::Storage::Pickers::FolderPicker* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_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.Pickers.FolderPicker", L"PickSingleFolderAsync", 0);
                }

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

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

    static PyObject* FolderPicker_get_ViewMode(py::wrapper::Windows::Storage::Pickers::FolderPicker* 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.Pickers.FolderPicker", L"ViewMode");
            }

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

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

    static int FolderPicker_put_ViewMode(py::wrapper::Windows::Storage::Pickers::FolderPicker* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            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.Pickers.FolderPicker", L"ViewMode");
            }

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

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

    static PyObject* FolderPicker_get_SuggestedStartLocation(py::wrapper::Windows::Storage::Pickers::FolderPicker* 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.Pickers.FolderPicker", L"SuggestedStartLocation");
            }

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

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

    static int FolderPicker_put_SuggestedStartLocation(py::wrapper::Windows::Storage::Pickers::FolderPicker* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            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.Pickers.FolderPicker", L"SuggestedStartLocation");
            }

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

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

    static PyObject* FolderPicker_get_SettingsIdentifier(py::wrapper::Windows::Storage::Pickers::FolderPicker* 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.Pickers.FolderPicker", L"SettingsIdentifier");
            }

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

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

    static int FolderPicker_put_SettingsIdentifier(py::wrapper::Windows::Storage::Pickers::FolderPicker* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            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.Pickers.FolderPicker", L"SettingsIdentifier");
            }

            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);

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

    static PyObject* FolderPicker_get_CommitButtonText(py::wrapper::Windows::Storage::Pickers::FolderPicker* 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.Pickers.FolderPicker", L"CommitButtonText");
            }

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

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

    static int FolderPicker_put_CommitButtonText(py::wrapper::Windows::Storage::Pickers::FolderPicker* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            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.Pickers.FolderPicker", L"CommitButtonText");
            }

            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);

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

    static PyObject* FolderPicker_get_FileTypeFilter(py::wrapper::Windows::Storage::Pickers::FolderPicker* 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.Pickers.FolderPicker", 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(self->obj.FileTypeFilter());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* FolderPicker_get_ContinuationData(py::wrapper::Windows::Storage::Pickers::FolderPicker* 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.Pickers.FolderPicker", L"ContinuationData");
            }

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

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

    static PyObject* FolderPicker_get_User(py::wrapper::Windows::Storage::Pickers::FolderPicker* 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.Pickers.FolderPicker", L"User");
            }

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

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

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

    static PyObject* _from_FolderPicker(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::Pickers::FolderPicker>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_FolderPicker[] = {
        { "pick_folder_and_continue", reinterpret_cast<PyCFunction>(FolderPicker_PickFolderAndContinue), METH_VARARGS, nullptr },
        { "pick_single_folder_async", reinterpret_cast<PyCFunction>(FolderPicker_PickSingleFolderAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_FolderPicker, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_FolderPicker), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_FolderPicker[] = {
        { "view_mode", reinterpret_cast<getter>(FolderPicker_get_ViewMode), reinterpret_cast<setter>(FolderPicker_put_ViewMode), nullptr, nullptr },
        { "suggested_start_location", reinterpret_cast<getter>(FolderPicker_get_SuggestedStartLocation), reinterpret_cast<setter>(FolderPicker_put_SuggestedStartLocation), nullptr, nullptr },
        { "settings_identifier", reinterpret_cast<getter>(FolderPicker_get_SettingsIdentifier), reinterpret_cast<setter>(FolderPicker_put_SettingsIdentifier), nullptr, nullptr },
        { "commit_button_text", reinterpret_cast<getter>(FolderPicker_get_CommitButtonText), reinterpret_cast<setter>(FolderPicker_put_CommitButtonText), nullptr, nullptr },
        { "file_type_filter", reinterpret_cast<getter>(FolderPicker_get_FileTypeFilter), nullptr, nullptr, nullptr },
        { "continuation_data", reinterpret_cast<getter>(FolderPicker_get_ContinuationData), nullptr, nullptr, nullptr },
        { "user", reinterpret_cast<getter>(FolderPicker_get_User), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_FolderPicker[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_FolderPicker) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_FolderPicker) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_FolderPicker) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_FolderPicker) },
        { }
    };

    static PyType_Spec type_spec_FolderPicker = {
        "winrt._winrt_windows_storage_pickers.FolderPicker",
        sizeof(py::wrapper::Windows::Storage::Pickers::FolderPicker),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_FolderPicker};

    static PyGetSetDef getset_FolderPicker_Static[] = {
        { }
    };

    static PyMethodDef methods_FolderPicker_Static[] = {
        { "create_for_user", reinterpret_cast<PyCFunction>(FolderPicker_CreateForUser), METH_VARARGS, nullptr },
        { }
    };

    static PyType_Slot type_slots_FolderPicker_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_FolderPicker_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_FolderPicker_Static) },
        { }
    };

    static PyType_Spec type_spec_FolderPicker_Static =
    {
        "winrt._winrt_windows_storage_pickers.FolderPicker_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_FolderPicker_Static
    };

    // ----- Windows.Storage.Pickers Initialization --------------------

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

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

PyMODINIT_FUNC PyInit__winrt_windows_storage_pickers(void) noexcept
{
    using namespace py::cpp::Windows::Storage::Pickers;

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

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

    if (!module)
    {
        return nullptr;
    }

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

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

    if (!object_bases)
    {
        return nullptr;
    }

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

    py::pyobj_handle type_FileOpenPicker_Static{PyType_FromSpec(&type_spec_FileOpenPicker_Static)};
    if (!type_FileOpenPicker_Static)
    {
        return nullptr;
    }

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

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

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

    py::pyobj_handle type_FileSavePicker_Static{PyType_FromSpec(&type_spec_FileSavePicker_Static)};
    if (!type_FileSavePicker_Static)
    {
        return nullptr;
    }

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

    py::pyobj_handle type_FolderPicker_Static{PyType_FromSpec(&type_spec_FolderPicker_Static)};
    if (!type_FolderPicker_Static)
    {
        return nullptr;
    }

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


    return module.detach();
}
