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

#include "pybase.h"
#include "py.Windows.Foundation.Collections.h"


namespace py::cpp::Windows::Foundation::Collections
{
    struct module_state
    {
        PyObject* type_CollectionChange;
        PyTypeObject* type_PropertySet;
        PyTypeObject* type_StringMap;
        PyTypeObject* type_ValueSet;
        PyTypeObject* type_IIterable;
        PyTypeObject* type_IIterator;
        PyTypeObject* type_IKeyValuePair;
        PyTypeObject* type_IMapChangedEventArgs;
        PyTypeObject* type_IMapView;
        PyTypeObject* type_IMap;
        PyTypeObject* type_IObservableMap;
        PyTypeObject* type_IObservableVector;
        PyTypeObject* type_IPropertySet;
        PyTypeObject* type_IVectorChangedEventArgs;
        PyTypeObject* type_IVectorView;
        PyTypeObject* type_IVector;
    };

    static PyObject* register_CollectionChange(PyObject* module, PyObject* type) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
        assert(state);

        if (state->type_CollectionChange)
        {
            PyErr_SetString(PyExc_RuntimeError, "type has already been registered");
            return nullptr;
        }

        if (!PyType_Check(type))
        {
            PyErr_SetString(PyExc_TypeError, "argument is not a type");
            return nullptr;
        }

        state->type_CollectionChange = type;
        Py_INCREF(state->type_CollectionChange);


        Py_RETURN_NONE;
    }

    // ----- PropertySet class --------------------
    static constexpr const char* const type_name_PropertySet = "PropertySet";

    static PyObject* _new_PropertySet(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::Foundation::Collections::PropertySet 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_PropertySet(py::wrapper::Windows::Foundation::Collections::PropertySet* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PropertySet_Clear(py::wrapper::Windows::Foundation::Collections::PropertySet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.PropertySet", L"Clear", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                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* PropertySet_First(py::wrapper::Windows::Foundation::Collections::PropertySet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.PropertySet", L"First", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                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* PropertySet_GetView(py::wrapper::Windows::Foundation::Collections::PropertySet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.PropertySet", L"GetView", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                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* PropertySet_HasKey(py::wrapper::Windows::Foundation::Collections::PropertySet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.PropertySet", L"HasKey", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                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* PropertySet_Insert(py::wrapper::Windows::Foundation::Collections::PropertySet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.PropertySet", L"Insert", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::hstring>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::IInspectable>(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* PropertySet_Lookup(py::wrapper::Windows::Foundation::Collections::PropertySet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.PropertySet", L"Lookup", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                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* PropertySet_Remove(py::wrapper::Windows::Foundation::Collections::PropertySet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.PropertySet", L"Remove", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                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* PropertySet_get_Size(py::wrapper::Windows::Foundation::Collections::PropertySet* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Foundation.Collections.PropertySet", L"Size"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* PropertySet_add_MapChanged(py::wrapper::Windows::Foundation::Collections::PropertySet* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Foundation.Collections.PropertySet", L"MapChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::Collections::MapChangedEventHandler<winrt::hstring, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* PropertySet_remove_MapChanged(py::wrapper::Windows::Foundation::Collections::PropertySet* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Foundation.Collections.PropertySet", L"MapChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

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

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

    static PyObject* _from_PropertySet(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::Foundation::Collections::PropertySet>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _iterator_PropertySet(py::wrapper::Windows::Foundation::Collections::PropertySet* self) noexcept
    {
        try
        {
            py::pyobj_handle iter{py::convert(self->obj.First())};
            return py::wrap_mapping_iter(iter.get());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int _map_contains_PropertySet(py::wrapper::Windows::Foundation::Collections::PropertySet* 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_PropertySet(py::wrapper::Windows::Foundation::Collections::PropertySet* self) noexcept
    {
        try
        {
            return static_cast<Py_ssize_t>(self->obj.Size());
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* _map_subscript_PropertySet(py::wrapper::Windows::Foundation::Collections::PropertySet* self, PyObject* key) noexcept
    {
        try
        {
            auto value = self->obj.TryLookup(py::convert_to<winrt::hstring>(key));

            if (!value) {
                PyErr_SetObject(PyExc_KeyError, key);
                return nullptr;
            }

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

    static int _map_assign_PropertySet(py::wrapper::Windows::Foundation::Collections::PropertySet* 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::IInspectable>(value));

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

    static PyMethodDef _methods_PropertySet[] = {
        { "clear", reinterpret_cast<PyCFunction>(PropertySet_Clear), METH_VARARGS, nullptr },
        { "first", reinterpret_cast<PyCFunction>(PropertySet_First), METH_VARARGS, nullptr },
        { "get_view", reinterpret_cast<PyCFunction>(PropertySet_GetView), METH_VARARGS, nullptr },
        { "has_key", reinterpret_cast<PyCFunction>(PropertySet_HasKey), METH_VARARGS, nullptr },
        { "insert", reinterpret_cast<PyCFunction>(PropertySet_Insert), METH_VARARGS, nullptr },
        { "lookup", reinterpret_cast<PyCFunction>(PropertySet_Lookup), METH_VARARGS, nullptr },
        { "remove", reinterpret_cast<PyCFunction>(PropertySet_Remove), METH_VARARGS, nullptr },
        { "add_map_changed", reinterpret_cast<PyCFunction>(PropertySet_add_MapChanged), METH_O, nullptr },
        { "remove_map_changed", reinterpret_cast<PyCFunction>(PropertySet_remove_MapChanged), METH_O, nullptr },
        { "_assign_array_", _assign_array_PropertySet, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PropertySet), METH_O | METH_STATIC, nullptr },
        { }
    };

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

    static PyType_Slot _type_slots_PropertySet[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_PropertySet) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PropertySet) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PropertySet) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PropertySet) },
        { Py_tp_iter, reinterpret_cast<void*>(_iterator_PropertySet) },
        { Py_sq_contains, reinterpret_cast<void*>(_map_contains_PropertySet) },
        { Py_mp_length, reinterpret_cast<void*>(_map_length_PropertySet) },
        { Py_mp_subscript, reinterpret_cast<void*>(_map_subscript_PropertySet) },
        { Py_mp_ass_subscript, reinterpret_cast<void*>(_map_assign_PropertySet) },
        { },
    };

    static PyType_Spec type_spec_PropertySet =
    {
        "_winsdk_Windows_Foundation_Collections.PropertySet",
        sizeof(py::wrapper::Windows::Foundation::Collections::PropertySet),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PropertySet
    };

    // ----- StringMap class --------------------
    static constexpr const char* const type_name_StringMap = "StringMap";

    static PyObject* _new_StringMap(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::Foundation::Collections::StringMap 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_StringMap(py::wrapper::Windows::Foundation::Collections::StringMap* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* StringMap_Clear(py::wrapper::Windows::Foundation::Collections::StringMap* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.StringMap", L"Clear", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                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* StringMap_First(py::wrapper::Windows::Foundation::Collections::StringMap* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.StringMap", L"First", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                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* StringMap_GetView(py::wrapper::Windows::Foundation::Collections::StringMap* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.StringMap", L"GetView", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                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* StringMap_HasKey(py::wrapper::Windows::Foundation::Collections::StringMap* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.StringMap", L"HasKey", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                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* StringMap_Insert(py::wrapper::Windows::Foundation::Collections::StringMap* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.StringMap", L"Insert", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::hstring>(args, 0);
                auto param1 = py::convert_to<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* StringMap_Lookup(py::wrapper::Windows::Foundation::Collections::StringMap* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.StringMap", L"Lookup", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                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* StringMap_Remove(py::wrapper::Windows::Foundation::Collections::StringMap* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.StringMap", L"Remove", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                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* StringMap_get_Size(py::wrapper::Windows::Foundation::Collections::StringMap* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Foundation.Collections.StringMap", L"Size"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* StringMap_add_MapChanged(py::wrapper::Windows::Foundation::Collections::StringMap* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Foundation.Collections.StringMap", L"MapChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::Collections::MapChangedEventHandler<winrt::hstring, winrt::hstring>>(arg);

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

    static PyObject* StringMap_remove_MapChanged(py::wrapper::Windows::Foundation::Collections::StringMap* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Foundation.Collections.StringMap", L"MapChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

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

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

    static PyObject* _from_StringMap(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::Foundation::Collections::StringMap>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _iterator_StringMap(py::wrapper::Windows::Foundation::Collections::StringMap* self) noexcept
    {
        try
        {
            py::pyobj_handle iter{py::convert(self->obj.First())};
            return py::wrap_mapping_iter(iter.get());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int _map_contains_StringMap(py::wrapper::Windows::Foundation::Collections::StringMap* 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_StringMap(py::wrapper::Windows::Foundation::Collections::StringMap* self) noexcept
    {
        try
        {
            return static_cast<Py_ssize_t>(self->obj.Size());
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* _map_subscript_StringMap(py::wrapper::Windows::Foundation::Collections::StringMap* self, PyObject* key) noexcept
    {
        try
        {
            auto value = self->obj.TryLookup(py::convert_to<winrt::hstring>(key));

            if (!value) {
                PyErr_SetObject(PyExc_KeyError, key);
                return nullptr;
            }

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

    static int _map_assign_StringMap(py::wrapper::Windows::Foundation::Collections::StringMap* 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::hstring>(value));

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

    static PyMethodDef _methods_StringMap[] = {
        { "clear", reinterpret_cast<PyCFunction>(StringMap_Clear), METH_VARARGS, nullptr },
        { "first", reinterpret_cast<PyCFunction>(StringMap_First), METH_VARARGS, nullptr },
        { "get_view", reinterpret_cast<PyCFunction>(StringMap_GetView), METH_VARARGS, nullptr },
        { "has_key", reinterpret_cast<PyCFunction>(StringMap_HasKey), METH_VARARGS, nullptr },
        { "insert", reinterpret_cast<PyCFunction>(StringMap_Insert), METH_VARARGS, nullptr },
        { "lookup", reinterpret_cast<PyCFunction>(StringMap_Lookup), METH_VARARGS, nullptr },
        { "remove", reinterpret_cast<PyCFunction>(StringMap_Remove), METH_VARARGS, nullptr },
        { "add_map_changed", reinterpret_cast<PyCFunction>(StringMap_add_MapChanged), METH_O, nullptr },
        { "remove_map_changed", reinterpret_cast<PyCFunction>(StringMap_remove_MapChanged), METH_O, nullptr },
        { "_assign_array_", _assign_array_StringMap, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_StringMap), METH_O | METH_STATIC, nullptr },
        { }
    };

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

    static PyType_Slot _type_slots_StringMap[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_StringMap) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_StringMap) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_StringMap) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_StringMap) },
        { Py_tp_iter, reinterpret_cast<void*>(_iterator_StringMap) },
        { Py_sq_contains, reinterpret_cast<void*>(_map_contains_StringMap) },
        { Py_mp_length, reinterpret_cast<void*>(_map_length_StringMap) },
        { Py_mp_subscript, reinterpret_cast<void*>(_map_subscript_StringMap) },
        { Py_mp_ass_subscript, reinterpret_cast<void*>(_map_assign_StringMap) },
        { },
    };

    static PyType_Spec type_spec_StringMap =
    {
        "_winsdk_Windows_Foundation_Collections.StringMap",
        sizeof(py::wrapper::Windows::Foundation::Collections::StringMap),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_StringMap
    };

    // ----- ValueSet class --------------------
    static constexpr const char* const type_name_ValueSet = "ValueSet";

    static PyObject* _new_ValueSet(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::Foundation::Collections::ValueSet 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_ValueSet(py::wrapper::Windows::Foundation::Collections::ValueSet* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* ValueSet_Clear(py::wrapper::Windows::Foundation::Collections::ValueSet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.ValueSet", L"Clear", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                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* ValueSet_First(py::wrapper::Windows::Foundation::Collections::ValueSet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.ValueSet", L"First", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                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* ValueSet_GetView(py::wrapper::Windows::Foundation::Collections::ValueSet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.ValueSet", L"GetView", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                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* ValueSet_HasKey(py::wrapper::Windows::Foundation::Collections::ValueSet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.ValueSet", L"HasKey", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                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* ValueSet_Insert(py::wrapper::Windows::Foundation::Collections::ValueSet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.ValueSet", L"Insert", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::hstring>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::IInspectable>(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* ValueSet_Lookup(py::wrapper::Windows::Foundation::Collections::ValueSet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.ValueSet", L"Lookup", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                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* ValueSet_Remove(py::wrapper::Windows::Foundation::Collections::ValueSet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.ValueSet", L"Remove", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                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* ValueSet_get_Size(py::wrapper::Windows::Foundation::Collections::ValueSet* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Foundation.Collections.ValueSet", L"Size"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* ValueSet_add_MapChanged(py::wrapper::Windows::Foundation::Collections::ValueSet* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Foundation.Collections.ValueSet", L"MapChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::Collections::MapChangedEventHandler<winrt::hstring, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* ValueSet_remove_MapChanged(py::wrapper::Windows::Foundation::Collections::ValueSet* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Foundation.Collections.ValueSet", L"MapChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

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

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

    static PyObject* _from_ValueSet(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::Foundation::Collections::ValueSet>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _iterator_ValueSet(py::wrapper::Windows::Foundation::Collections::ValueSet* self) noexcept
    {
        try
        {
            py::pyobj_handle iter{py::convert(self->obj.First())};
            return py::wrap_mapping_iter(iter.get());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int _map_contains_ValueSet(py::wrapper::Windows::Foundation::Collections::ValueSet* 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_ValueSet(py::wrapper::Windows::Foundation::Collections::ValueSet* self) noexcept
    {
        try
        {
            return static_cast<Py_ssize_t>(self->obj.Size());
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* _map_subscript_ValueSet(py::wrapper::Windows::Foundation::Collections::ValueSet* self, PyObject* key) noexcept
    {
        try
        {
            auto value = self->obj.TryLookup(py::convert_to<winrt::hstring>(key));

            if (!value) {
                PyErr_SetObject(PyExc_KeyError, key);
                return nullptr;
            }

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

    static int _map_assign_ValueSet(py::wrapper::Windows::Foundation::Collections::ValueSet* 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::IInspectable>(value));

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

    static PyMethodDef _methods_ValueSet[] = {
        { "clear", reinterpret_cast<PyCFunction>(ValueSet_Clear), METH_VARARGS, nullptr },
        { "first", reinterpret_cast<PyCFunction>(ValueSet_First), METH_VARARGS, nullptr },
        { "get_view", reinterpret_cast<PyCFunction>(ValueSet_GetView), METH_VARARGS, nullptr },
        { "has_key", reinterpret_cast<PyCFunction>(ValueSet_HasKey), METH_VARARGS, nullptr },
        { "insert", reinterpret_cast<PyCFunction>(ValueSet_Insert), METH_VARARGS, nullptr },
        { "lookup", reinterpret_cast<PyCFunction>(ValueSet_Lookup), METH_VARARGS, nullptr },
        { "remove", reinterpret_cast<PyCFunction>(ValueSet_Remove), METH_VARARGS, nullptr },
        { "add_map_changed", reinterpret_cast<PyCFunction>(ValueSet_add_MapChanged), METH_O, nullptr },
        { "remove_map_changed", reinterpret_cast<PyCFunction>(ValueSet_remove_MapChanged), METH_O, nullptr },
        { "_assign_array_", _assign_array_ValueSet, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_ValueSet), METH_O | METH_STATIC, nullptr },
        { }
    };

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

    static PyType_Slot _type_slots_ValueSet[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_ValueSet) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_ValueSet) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_ValueSet) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_ValueSet) },
        { Py_tp_iter, reinterpret_cast<void*>(_iterator_ValueSet) },
        { Py_sq_contains, reinterpret_cast<void*>(_map_contains_ValueSet) },
        { Py_mp_length, reinterpret_cast<void*>(_map_length_ValueSet) },
        { Py_mp_subscript, reinterpret_cast<void*>(_map_subscript_ValueSet) },
        { Py_mp_ass_subscript, reinterpret_cast<void*>(_map_assign_ValueSet) },
        { },
    };

    static PyType_Spec type_spec_ValueSet =
    {
        "_winsdk_Windows_Foundation_Collections.ValueSet",
        sizeof(py::wrapper::Windows::Foundation::Collections::ValueSet),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_ValueSet
    };

    // ----- IIterable interface --------------------
    static constexpr const char* const type_name_IIterable = "IIterable";

    static PyObject* _new_IIterable(PyTypeObject* /* unused */, PyObject* /* unused */, PyObject* /* unused */) noexcept
    {
        py::set_invalid_activation_error(type_name_IIterable);
        return nullptr;
    }

    static void _dealloc_IIterable(py::wrapper::Windows::Foundation::Collections::IIterable* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* IIterable_First(py::wrapper::Windows::Foundation::Collections::IIterable* self, PyObject* args) noexcept
    {
        return self->obj->First(args);
    }

    static PyObject* _iterator_IIterable(py::wrapper::Windows::Foundation::Collections::IIterable* self) noexcept
    {
        return self->obj->dunder_iter();
    }

    static PyMethodDef _methods_IIterable[] = {
        { "first", reinterpret_cast<PyCFunction>(IIterable_First), METH_VARARGS, nullptr },
        #if PY_VERSION_HEX >= 0x03090000
        { "__class_getitem__", Py_GenericAlias, METH_O | METH_CLASS, PyDoc_STR("See PEP 585") },
        #endif
        { }
    };

    static PyGetSetDef _getset_IIterable[] = {
        { }
    };

    static PyType_Slot _type_slots_IIterable[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_IIterable) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IIterable) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IIterable) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IIterable) },
        { Py_tp_iter, reinterpret_cast<void*>(_iterator_IIterable) },
        { },
    };

    static PyType_Spec type_spec_IIterable =
    {
        "_winsdk_Windows_Foundation_Collections.IIterable",
        sizeof(py::wrapper::Windows::Foundation::Collections::IIterable),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_IIterable
    };

    // ----- IIterator interface --------------------
    static constexpr const char* const type_name_IIterator = "IIterator";

    static PyObject* _new_IIterator(PyTypeObject* /* unused */, PyObject* /* unused */, PyObject* /* unused */) noexcept
    {
        py::set_invalid_activation_error(type_name_IIterator);
        return nullptr;
    }

    static void _dealloc_IIterator(py::wrapper::Windows::Foundation::Collections::IIterator* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* IIterator_GetMany(py::wrapper::Windows::Foundation::Collections::IIterator* self, PyObject* args) noexcept
    {
        return self->obj->GetMany(args);
    }

    static PyObject* IIterator_MoveNext(py::wrapper::Windows::Foundation::Collections::IIterator* self, PyObject* args) noexcept
    {
        return self->obj->MoveNext(args);
    }

    static PyObject* IIterator_get_Current(py::wrapper::Windows::Foundation::Collections::IIterator* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Foundation.Collections.IIterator`1", L"Current"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        return self->obj->get_Current();
    }

    static PyObject* IIterator_get_HasCurrent(py::wrapper::Windows::Foundation::Collections::IIterator* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Foundation.Collections.IIterator`1", L"HasCurrent"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        return self->obj->get_HasCurrent();
    }

    static PyObject* _iterator_IIterator(py::wrapper::Windows::Foundation::Collections::IIterator* self) noexcept
    {
        return self->obj->dunder_iter();
    }

    static PyObject* _iterator_next_IIterator(py::wrapper::Windows::Foundation::Collections::IIterator* self) noexcept
    {
        return self->obj->dunder_iternext();
    }

    static PyMethodDef _methods_IIterator[] = {
        { "get_many", reinterpret_cast<PyCFunction>(IIterator_GetMany), METH_VARARGS, nullptr },
        { "move_next", reinterpret_cast<PyCFunction>(IIterator_MoveNext), METH_VARARGS, nullptr },
        #if PY_VERSION_HEX >= 0x03090000
        { "__class_getitem__", Py_GenericAlias, METH_O | METH_CLASS, PyDoc_STR("See PEP 585") },
        #endif
        { }
    };

    static PyGetSetDef _getset_IIterator[] = {
        { "current", reinterpret_cast<getter>(IIterator_get_Current), nullptr, nullptr, nullptr },
        { "has_current", reinterpret_cast<getter>(IIterator_get_HasCurrent), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_IIterator[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_IIterator) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IIterator) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IIterator) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IIterator) },
        { Py_tp_iter, reinterpret_cast<void*>(_iterator_IIterator) },
        { Py_tp_iternext, reinterpret_cast<void*>(_iterator_next_IIterator) },
        { },
    };

    static PyType_Spec type_spec_IIterator =
    {
        "_winsdk_Windows_Foundation_Collections.IIterator",
        sizeof(py::wrapper::Windows::Foundation::Collections::IIterator),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_IIterator
    };

    // ----- IKeyValuePair interface --------------------
    static constexpr const char* const type_name_IKeyValuePair = "IKeyValuePair";

    static PyObject* _new_IKeyValuePair(PyTypeObject* /* unused */, PyObject* /* unused */, PyObject* /* unused */) noexcept
    {
        py::set_invalid_activation_error(type_name_IKeyValuePair);
        return nullptr;
    }

    static void _dealloc_IKeyValuePair(py::wrapper::Windows::Foundation::Collections::IKeyValuePair* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* IKeyValuePair_get_Key(py::wrapper::Windows::Foundation::Collections::IKeyValuePair* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Foundation.Collections.IKeyValuePair`2", L"Key"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        return self->obj->get_Key();
    }

    static PyObject* IKeyValuePair_get_Value(py::wrapper::Windows::Foundation::Collections::IKeyValuePair* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Foundation.Collections.IKeyValuePair`2", L"Value"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        return self->obj->get_Value();
    }

    static PyMethodDef _methods_IKeyValuePair[] = {
        #if PY_VERSION_HEX >= 0x03090000
        { "__class_getitem__", Py_GenericAlias, METH_O | METH_CLASS, PyDoc_STR("See PEP 585") },
        #endif
        { }
    };

    static PyGetSetDef _getset_IKeyValuePair[] = {
        { "key", reinterpret_cast<getter>(IKeyValuePair_get_Key), nullptr, nullptr, nullptr },
        { "value", reinterpret_cast<getter>(IKeyValuePair_get_Value), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_IKeyValuePair[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_IKeyValuePair) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IKeyValuePair) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IKeyValuePair) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IKeyValuePair) },
        { },
    };

    static PyType_Spec type_spec_IKeyValuePair =
    {
        "_winsdk_Windows_Foundation_Collections.IKeyValuePair",
        sizeof(py::wrapper::Windows::Foundation::Collections::IKeyValuePair),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_IKeyValuePair
    };

    // ----- IMapChangedEventArgs interface --------------------
    static constexpr const char* const type_name_IMapChangedEventArgs = "IMapChangedEventArgs";

    static PyObject* _new_IMapChangedEventArgs(PyTypeObject* /* unused */, PyObject* /* unused */, PyObject* /* unused */) noexcept
    {
        py::set_invalid_activation_error(type_name_IMapChangedEventArgs);
        return nullptr;
    }

    static void _dealloc_IMapChangedEventArgs(py::wrapper::Windows::Foundation::Collections::IMapChangedEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* IMapChangedEventArgs_get_CollectionChange(py::wrapper::Windows::Foundation::Collections::IMapChangedEventArgs* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Foundation.Collections.IMapChangedEventArgs`1", L"CollectionChange"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        return self->obj->get_CollectionChange();
    }

    static PyObject* IMapChangedEventArgs_get_Key(py::wrapper::Windows::Foundation::Collections::IMapChangedEventArgs* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Foundation.Collections.IMapChangedEventArgs`1", L"Key"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        return self->obj->get_Key();
    }

    static PyMethodDef _methods_IMapChangedEventArgs[] = {
        #if PY_VERSION_HEX >= 0x03090000
        { "__class_getitem__", Py_GenericAlias, METH_O | METH_CLASS, PyDoc_STR("See PEP 585") },
        #endif
        { }
    };

    static PyGetSetDef _getset_IMapChangedEventArgs[] = {
        { "collection_change", reinterpret_cast<getter>(IMapChangedEventArgs_get_CollectionChange), nullptr, nullptr, nullptr },
        { "key", reinterpret_cast<getter>(IMapChangedEventArgs_get_Key), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_IMapChangedEventArgs[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_IMapChangedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IMapChangedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IMapChangedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IMapChangedEventArgs) },
        { },
    };

    static PyType_Spec type_spec_IMapChangedEventArgs =
    {
        "_winsdk_Windows_Foundation_Collections.IMapChangedEventArgs",
        sizeof(py::wrapper::Windows::Foundation::Collections::IMapChangedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_IMapChangedEventArgs
    };

    // ----- IMapView interface --------------------
    static constexpr const char* const type_name_IMapView = "IMapView";

    static PyObject* _new_IMapView(PyTypeObject* /* unused */, PyObject* /* unused */, PyObject* /* unused */) noexcept
    {
        py::set_invalid_activation_error(type_name_IMapView);
        return nullptr;
    }

    static void _dealloc_IMapView(py::wrapper::Windows::Foundation::Collections::IMapView* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* IMapView_First(py::wrapper::Windows::Foundation::Collections::IMapView* self, PyObject* args) noexcept
    {
        return self->obj->First(args);
    }

    static PyObject* IMapView_HasKey(py::wrapper::Windows::Foundation::Collections::IMapView* self, PyObject* args) noexcept
    {
        return self->obj->HasKey(args);
    }

    static PyObject* IMapView_Lookup(py::wrapper::Windows::Foundation::Collections::IMapView* self, PyObject* args) noexcept
    {
        return self->obj->Lookup(args);
    }

    static PyObject* IMapView_Split(py::wrapper::Windows::Foundation::Collections::IMapView* self, PyObject* args) noexcept
    {
        return self->obj->Split(args);
    }

    static PyObject* IMapView_get_Size(py::wrapper::Windows::Foundation::Collections::IMapView* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Foundation.Collections.IMapView`2", L"Size"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        return self->obj->get_Size();
    }

    static PyObject* _iterator_IMapView(py::wrapper::Windows::Foundation::Collections::IMapView* self) noexcept
    {
        return self->obj->dunder_iter();
    }

    static int _map_contains_IMapView(py::wrapper::Windows::Foundation::Collections::IMapView* self, PyObject* key) noexcept
    {
        return self->obj->map_contains(key);
    }

    static Py_ssize_t _map_length_IMapView(py::wrapper::Windows::Foundation::Collections::IMapView* self) noexcept
    {
        return self->obj->map_length();
    }

    static PyObject* _map_subscript_IMapView(py::wrapper::Windows::Foundation::Collections::IMapView* self, PyObject* key) noexcept
    {
        return self->obj->map_subscript(key);
    }

    static PyMethodDef _methods_IMapView[] = {
        { "first", reinterpret_cast<PyCFunction>(IMapView_First), METH_VARARGS, nullptr },
        { "has_key", reinterpret_cast<PyCFunction>(IMapView_HasKey), METH_VARARGS, nullptr },
        { "lookup", reinterpret_cast<PyCFunction>(IMapView_Lookup), METH_VARARGS, nullptr },
        { "split", reinterpret_cast<PyCFunction>(IMapView_Split), METH_VARARGS, nullptr },
        #if PY_VERSION_HEX >= 0x03090000
        { "__class_getitem__", Py_GenericAlias, METH_O | METH_CLASS, PyDoc_STR("See PEP 585") },
        #endif
        { }
    };

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

    static PyType_Slot _type_slots_IMapView[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_IMapView) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IMapView) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IMapView) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IMapView) },
        { Py_tp_iter, reinterpret_cast<void*>(_iterator_IMapView) },
        { Py_sq_contains, reinterpret_cast<void*>(_map_contains_IMapView) },
        { Py_mp_length, reinterpret_cast<void*>(_map_length_IMapView) },
        { Py_mp_subscript, reinterpret_cast<void*>(_map_subscript_IMapView) },
        { },
    };

    static PyType_Spec type_spec_IMapView =
    {
        "_winsdk_Windows_Foundation_Collections.IMapView",
        sizeof(py::wrapper::Windows::Foundation::Collections::IMapView),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_IMapView
    };

    // ----- IMap interface --------------------
    static constexpr const char* const type_name_IMap = "IMap";

    static PyObject* _new_IMap(PyTypeObject* /* unused */, PyObject* /* unused */, PyObject* /* unused */) noexcept
    {
        py::set_invalid_activation_error(type_name_IMap);
        return nullptr;
    }

    static void _dealloc_IMap(py::wrapper::Windows::Foundation::Collections::IMap* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* IMap_Clear(py::wrapper::Windows::Foundation::Collections::IMap* self, PyObject* args) noexcept
    {
        return self->obj->Clear(args);
    }

    static PyObject* IMap_First(py::wrapper::Windows::Foundation::Collections::IMap* self, PyObject* args) noexcept
    {
        return self->obj->First(args);
    }

    static PyObject* IMap_GetView(py::wrapper::Windows::Foundation::Collections::IMap* self, PyObject* args) noexcept
    {
        return self->obj->GetView(args);
    }

    static PyObject* IMap_HasKey(py::wrapper::Windows::Foundation::Collections::IMap* self, PyObject* args) noexcept
    {
        return self->obj->HasKey(args);
    }

    static PyObject* IMap_Insert(py::wrapper::Windows::Foundation::Collections::IMap* self, PyObject* args) noexcept
    {
        return self->obj->Insert(args);
    }

    static PyObject* IMap_Lookup(py::wrapper::Windows::Foundation::Collections::IMap* self, PyObject* args) noexcept
    {
        return self->obj->Lookup(args);
    }

    static PyObject* IMap_Remove(py::wrapper::Windows::Foundation::Collections::IMap* self, PyObject* args) noexcept
    {
        return self->obj->Remove(args);
    }

    static PyObject* IMap_get_Size(py::wrapper::Windows::Foundation::Collections::IMap* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Foundation.Collections.IMap`2", L"Size"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        return self->obj->get_Size();
    }

    static PyObject* _iterator_IMap(py::wrapper::Windows::Foundation::Collections::IMap* self) noexcept
    {
        return self->obj->dunder_iter();
    }

    static int _map_contains_IMap(py::wrapper::Windows::Foundation::Collections::IMap* self, PyObject* key) noexcept
    {
        return self->obj->map_contains(key);
    }

    static Py_ssize_t _map_length_IMap(py::wrapper::Windows::Foundation::Collections::IMap* self) noexcept
    {
        return self->obj->map_length();
    }

    static PyObject* _map_subscript_IMap(py::wrapper::Windows::Foundation::Collections::IMap* self, PyObject* key) noexcept
    {
        return self->obj->map_subscript(key);
    }

    static int _map_assign_IMap(py::wrapper::Windows::Foundation::Collections::IMap* self, PyObject* key, PyObject* value) noexcept
    {
        return self->obj->map_assign(key, value);
    }

    static PyMethodDef _methods_IMap[] = {
        { "clear", reinterpret_cast<PyCFunction>(IMap_Clear), METH_VARARGS, nullptr },
        { "first", reinterpret_cast<PyCFunction>(IMap_First), METH_VARARGS, nullptr },
        { "get_view", reinterpret_cast<PyCFunction>(IMap_GetView), METH_VARARGS, nullptr },
        { "has_key", reinterpret_cast<PyCFunction>(IMap_HasKey), METH_VARARGS, nullptr },
        { "insert", reinterpret_cast<PyCFunction>(IMap_Insert), METH_VARARGS, nullptr },
        { "lookup", reinterpret_cast<PyCFunction>(IMap_Lookup), METH_VARARGS, nullptr },
        { "remove", reinterpret_cast<PyCFunction>(IMap_Remove), METH_VARARGS, nullptr },
        #if PY_VERSION_HEX >= 0x03090000
        { "__class_getitem__", Py_GenericAlias, METH_O | METH_CLASS, PyDoc_STR("See PEP 585") },
        #endif
        { }
    };

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

    static PyType_Slot _type_slots_IMap[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_IMap) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IMap) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IMap) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IMap) },
        { Py_tp_iter, reinterpret_cast<void*>(_iterator_IMap) },
        { Py_sq_contains, reinterpret_cast<void*>(_map_contains_IMap) },
        { Py_mp_length, reinterpret_cast<void*>(_map_length_IMap) },
        { Py_mp_subscript, reinterpret_cast<void*>(_map_subscript_IMap) },
        { Py_mp_ass_subscript, reinterpret_cast<void*>(_map_assign_IMap) },
        { },
    };

    static PyType_Spec type_spec_IMap =
    {
        "_winsdk_Windows_Foundation_Collections.IMap",
        sizeof(py::wrapper::Windows::Foundation::Collections::IMap),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_IMap
    };

    // ----- IObservableMap interface --------------------
    static constexpr const char* const type_name_IObservableMap = "IObservableMap";

    static PyObject* _new_IObservableMap(PyTypeObject* /* unused */, PyObject* /* unused */, PyObject* /* unused */) noexcept
    {
        py::set_invalid_activation_error(type_name_IObservableMap);
        return nullptr;
    }

    static void _dealloc_IObservableMap(py::wrapper::Windows::Foundation::Collections::IObservableMap* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* IObservableMap_Clear(py::wrapper::Windows::Foundation::Collections::IObservableMap* self, PyObject* args) noexcept
    {
        return self->obj->Clear(args);
    }

    static PyObject* IObservableMap_First(py::wrapper::Windows::Foundation::Collections::IObservableMap* self, PyObject* args) noexcept
    {
        return self->obj->First(args);
    }

    static PyObject* IObservableMap_GetView(py::wrapper::Windows::Foundation::Collections::IObservableMap* self, PyObject* args) noexcept
    {
        return self->obj->GetView(args);
    }

    static PyObject* IObservableMap_HasKey(py::wrapper::Windows::Foundation::Collections::IObservableMap* self, PyObject* args) noexcept
    {
        return self->obj->HasKey(args);
    }

    static PyObject* IObservableMap_Insert(py::wrapper::Windows::Foundation::Collections::IObservableMap* self, PyObject* args) noexcept
    {
        return self->obj->Insert(args);
    }

    static PyObject* IObservableMap_Lookup(py::wrapper::Windows::Foundation::Collections::IObservableMap* self, PyObject* args) noexcept
    {
        return self->obj->Lookup(args);
    }

    static PyObject* IObservableMap_Remove(py::wrapper::Windows::Foundation::Collections::IObservableMap* self, PyObject* args) noexcept
    {
        return self->obj->Remove(args);
    }

    static PyObject* IObservableMap_get_Size(py::wrapper::Windows::Foundation::Collections::IObservableMap* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Foundation.Collections.IMap`2", L"Size"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        return self->obj->get_Size();
    }

    static PyObject* IObservableMap_add_MapChanged(py::wrapper::Windows::Foundation::Collections::IObservableMap* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Foundation.Collections.IObservableMap`2", L"MapChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        return self->obj->add_MapChanged(arg);
    }

    static PyObject* IObservableMap_remove_MapChanged(py::wrapper::Windows::Foundation::Collections::IObservableMap* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Foundation.Collections.IObservableMap`2", L"MapChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        return self->obj->remove_MapChanged(arg);
    }

    static PyObject* _iterator_IObservableMap(py::wrapper::Windows::Foundation::Collections::IObservableMap* self) noexcept
    {
        return self->obj->dunder_iter();
    }

    static int _map_contains_IObservableMap(py::wrapper::Windows::Foundation::Collections::IObservableMap* self, PyObject* key) noexcept
    {
        return self->obj->map_contains(key);
    }

    static Py_ssize_t _map_length_IObservableMap(py::wrapper::Windows::Foundation::Collections::IObservableMap* self) noexcept
    {
        return self->obj->map_length();
    }

    static PyObject* _map_subscript_IObservableMap(py::wrapper::Windows::Foundation::Collections::IObservableMap* self, PyObject* key) noexcept
    {
        return self->obj->map_subscript(key);
    }

    static int _map_assign_IObservableMap(py::wrapper::Windows::Foundation::Collections::IObservableMap* self, PyObject* key, PyObject* value) noexcept
    {
        return self->obj->map_assign(key, value);
    }

    static PyMethodDef _methods_IObservableMap[] = {
        { "clear", reinterpret_cast<PyCFunction>(IObservableMap_Clear), METH_VARARGS, nullptr },
        { "first", reinterpret_cast<PyCFunction>(IObservableMap_First), METH_VARARGS, nullptr },
        { "get_view", reinterpret_cast<PyCFunction>(IObservableMap_GetView), METH_VARARGS, nullptr },
        { "has_key", reinterpret_cast<PyCFunction>(IObservableMap_HasKey), METH_VARARGS, nullptr },
        { "insert", reinterpret_cast<PyCFunction>(IObservableMap_Insert), METH_VARARGS, nullptr },
        { "lookup", reinterpret_cast<PyCFunction>(IObservableMap_Lookup), METH_VARARGS, nullptr },
        { "remove", reinterpret_cast<PyCFunction>(IObservableMap_Remove), METH_VARARGS, nullptr },
        { "add_map_changed", reinterpret_cast<PyCFunction>(IObservableMap_add_MapChanged), METH_O, nullptr },
        { "remove_map_changed", reinterpret_cast<PyCFunction>(IObservableMap_remove_MapChanged), METH_O, nullptr },
        #if PY_VERSION_HEX >= 0x03090000
        { "__class_getitem__", Py_GenericAlias, METH_O | METH_CLASS, PyDoc_STR("See PEP 585") },
        #endif
        { }
    };

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

    static PyType_Slot _type_slots_IObservableMap[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_IObservableMap) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IObservableMap) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IObservableMap) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IObservableMap) },
        { Py_tp_iter, reinterpret_cast<void*>(_iterator_IObservableMap) },
        { Py_sq_contains, reinterpret_cast<void*>(_map_contains_IObservableMap) },
        { Py_mp_length, reinterpret_cast<void*>(_map_length_IObservableMap) },
        { Py_mp_subscript, reinterpret_cast<void*>(_map_subscript_IObservableMap) },
        { Py_mp_ass_subscript, reinterpret_cast<void*>(_map_assign_IObservableMap) },
        { },
    };

    static PyType_Spec type_spec_IObservableMap =
    {
        "_winsdk_Windows_Foundation_Collections.IObservableMap",
        sizeof(py::wrapper::Windows::Foundation::Collections::IObservableMap),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_IObservableMap
    };

    // ----- IObservableVector interface --------------------
    static constexpr const char* const type_name_IObservableVector = "IObservableVector";

    static PyObject* _new_IObservableVector(PyTypeObject* /* unused */, PyObject* /* unused */, PyObject* /* unused */) noexcept
    {
        py::set_invalid_activation_error(type_name_IObservableVector);
        return nullptr;
    }

    static void _dealloc_IObservableVector(py::wrapper::Windows::Foundation::Collections::IObservableVector* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* IObservableVector_Append(py::wrapper::Windows::Foundation::Collections::IObservableVector* self, PyObject* args) noexcept
    {
        return self->obj->Append(args);
    }

    static PyObject* IObservableVector_Clear(py::wrapper::Windows::Foundation::Collections::IObservableVector* self, PyObject* args) noexcept
    {
        return self->obj->Clear(args);
    }

    static PyObject* IObservableVector_First(py::wrapper::Windows::Foundation::Collections::IObservableVector* self, PyObject* args) noexcept
    {
        return self->obj->First(args);
    }

    static PyObject* IObservableVector_GetAt(py::wrapper::Windows::Foundation::Collections::IObservableVector* self, PyObject* args) noexcept
    {
        return self->obj->GetAt(args);
    }

    static PyObject* IObservableVector_GetMany(py::wrapper::Windows::Foundation::Collections::IObservableVector* self, PyObject* args) noexcept
    {
        return self->obj->GetMany(args);
    }

    static PyObject* IObservableVector_GetView(py::wrapper::Windows::Foundation::Collections::IObservableVector* self, PyObject* args) noexcept
    {
        return self->obj->GetView(args);
    }

    static PyObject* IObservableVector_IndexOf(py::wrapper::Windows::Foundation::Collections::IObservableVector* self, PyObject* args) noexcept
    {
        return self->obj->IndexOf(args);
    }

    static PyObject* IObservableVector_InsertAt(py::wrapper::Windows::Foundation::Collections::IObservableVector* self, PyObject* args) noexcept
    {
        return self->obj->InsertAt(args);
    }

    static PyObject* IObservableVector_RemoveAt(py::wrapper::Windows::Foundation::Collections::IObservableVector* self, PyObject* args) noexcept
    {
        return self->obj->RemoveAt(args);
    }

    static PyObject* IObservableVector_RemoveAtEnd(py::wrapper::Windows::Foundation::Collections::IObservableVector* self, PyObject* args) noexcept
    {
        return self->obj->RemoveAtEnd(args);
    }

    static PyObject* IObservableVector_ReplaceAll(py::wrapper::Windows::Foundation::Collections::IObservableVector* self, PyObject* args) noexcept
    {
        return self->obj->ReplaceAll(args);
    }

    static PyObject* IObservableVector_SetAt(py::wrapper::Windows::Foundation::Collections::IObservableVector* self, PyObject* args) noexcept
    {
        return self->obj->SetAt(args);
    }

    static PyObject* IObservableVector_get_Size(py::wrapper::Windows::Foundation::Collections::IObservableVector* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Foundation.Collections.IVector`1", L"Size"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        return self->obj->get_Size();
    }

    static PyObject* IObservableVector_add_VectorChanged(py::wrapper::Windows::Foundation::Collections::IObservableVector* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Foundation.Collections.IObservableVector`1", L"VectorChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        return self->obj->add_VectorChanged(arg);
    }

    static PyObject* IObservableVector_remove_VectorChanged(py::wrapper::Windows::Foundation::Collections::IObservableVector* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Foundation.Collections.IObservableVector`1", L"VectorChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        return self->obj->remove_VectorChanged(arg);
    }

    static PyObject* _iterator_IObservableVector(py::wrapper::Windows::Foundation::Collections::IObservableVector* self) noexcept
    {
        return self->obj->dunder_iter();
    }

    static Py_ssize_t _seq_length_IObservableVector(py::wrapper::Windows::Foundation::Collections::IObservableVector* self) noexcept
    {
        return self->obj->seq_length();
    }

    static PyObject* _seq_item_IObservableVector(py::wrapper::Windows::Foundation::Collections::IObservableVector* self, Py_ssize_t i) noexcept
    {
        return self->obj->seq_item(i);
    }

    static PyObject* _seq_subscript_IObservableVector(py::wrapper::Windows::Foundation::Collections::IObservableVector* self, PyObject* slice) noexcept
    {
        return self->obj->seq_subscript(slice);
    }

    static int _seq_assign_IObservableVector(py::wrapper::Windows::Foundation::Collections::IObservableVector* self, Py_ssize_t i, PyObject* value) noexcept
    {
        return self->obj->seq_assign(i, value);
    }

    static PyObject* IObservableVector_get_insert(PyObject* self) noexcept
    {
        return PyObject_GetAttrString(self, "insert_at");
    }

    static PyMethodDef _methods_IObservableVector[] = {
        { "append", reinterpret_cast<PyCFunction>(IObservableVector_Append), METH_VARARGS, nullptr },
        { "clear", reinterpret_cast<PyCFunction>(IObservableVector_Clear), METH_VARARGS, nullptr },
        { "first", reinterpret_cast<PyCFunction>(IObservableVector_First), METH_VARARGS, nullptr },
        { "get_at", reinterpret_cast<PyCFunction>(IObservableVector_GetAt), METH_VARARGS, nullptr },
        { "get_many", reinterpret_cast<PyCFunction>(IObservableVector_GetMany), METH_VARARGS, nullptr },
        { "get_view", reinterpret_cast<PyCFunction>(IObservableVector_GetView), METH_VARARGS, nullptr },
        { "index_of", reinterpret_cast<PyCFunction>(IObservableVector_IndexOf), METH_VARARGS, nullptr },
        { "insert_at", reinterpret_cast<PyCFunction>(IObservableVector_InsertAt), METH_VARARGS, nullptr },
        { "remove_at", reinterpret_cast<PyCFunction>(IObservableVector_RemoveAt), METH_VARARGS, nullptr },
        { "remove_at_end", reinterpret_cast<PyCFunction>(IObservableVector_RemoveAtEnd), METH_VARARGS, nullptr },
        { "replace_all", reinterpret_cast<PyCFunction>(IObservableVector_ReplaceAll), METH_VARARGS, nullptr },
        { "set_at", reinterpret_cast<PyCFunction>(IObservableVector_SetAt), METH_VARARGS, nullptr },
        { "add_vector_changed", reinterpret_cast<PyCFunction>(IObservableVector_add_VectorChanged), METH_O, nullptr },
        { "remove_vector_changed", reinterpret_cast<PyCFunction>(IObservableVector_remove_VectorChanged), METH_O, nullptr },
        #if PY_VERSION_HEX >= 0x03090000
        { "__class_getitem__", Py_GenericAlias, METH_O | METH_CLASS, PyDoc_STR("See PEP 585") },
        #endif
        { }
    };

    static PyGetSetDef _getset_IObservableVector[] = {
        { "size", reinterpret_cast<getter>(IObservableVector_get_Size), nullptr, nullptr, nullptr },
        { "insert", reinterpret_cast<getter>(IObservableVector_get_insert), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_IObservableVector[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_IObservableVector) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IObservableVector) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IObservableVector) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IObservableVector) },
        { Py_tp_iter, reinterpret_cast<void*>(_iterator_IObservableVector) },
        { Py_sq_length, reinterpret_cast<void*>(_seq_length_IObservableVector) },
        { Py_sq_item, reinterpret_cast<void*>(_seq_item_IObservableVector) },
        { Py_mp_subscript, reinterpret_cast<void*>(_seq_subscript_IObservableVector) },
        { Py_sq_ass_item, reinterpret_cast<void*>(_seq_assign_IObservableVector) },
        { },
    };

    static PyType_Spec type_spec_IObservableVector =
    {
        "_winsdk_Windows_Foundation_Collections.IObservableVector",
        sizeof(py::wrapper::Windows::Foundation::Collections::IObservableVector),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_IObservableVector
    };

    // ----- IPropertySet interface --------------------
    static constexpr const char* const type_name_IPropertySet = "IPropertySet";

    static PyObject* _new_IPropertySet(PyTypeObject* /* unused */, PyObject* /* unused */, PyObject* /* unused */) noexcept
    {
        py::set_invalid_activation_error(type_name_IPropertySet);
        return nullptr;
    }

    static void _dealloc_IPropertySet(py::wrapper::Windows::Foundation::Collections::IPropertySet* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* IPropertySet_Clear(py::wrapper::Windows::Foundation::Collections::IPropertySet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.IMap`2", L"Clear", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                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* IPropertySet_First(py::wrapper::Windows::Foundation::Collections::IPropertySet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.IIterable`1", L"First", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                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* IPropertySet_GetView(py::wrapper::Windows::Foundation::Collections::IPropertySet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.IMap`2", L"GetView", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                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* IPropertySet_HasKey(py::wrapper::Windows::Foundation::Collections::IPropertySet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.IMap`2", L"HasKey", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                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* IPropertySet_Insert(py::wrapper::Windows::Foundation::Collections::IPropertySet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.IMap`2", L"Insert", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::hstring>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::IInspectable>(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* IPropertySet_Lookup(py::wrapper::Windows::Foundation::Collections::IPropertySet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.IMap`2", L"Lookup", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                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* IPropertySet_Remove(py::wrapper::Windows::Foundation::Collections::IPropertySet* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Foundation.Collections.IMap`2", L"Remove", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                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* IPropertySet_get_Size(py::wrapper::Windows::Foundation::Collections::IPropertySet* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Foundation.Collections.IMap`2", L"Size"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* IPropertySet_add_MapChanged(py::wrapper::Windows::Foundation::Collections::IPropertySet* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Foundation.Collections.IObservableMap`2", L"MapChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::Collections::MapChangedEventHandler<winrt::hstring, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* IPropertySet_remove_MapChanged(py::wrapper::Windows::Foundation::Collections::IPropertySet* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Foundation.Collections.IObservableMap`2", L"MapChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

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

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

    static PyObject* _from_IPropertySet(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::Foundation::Collections::IPropertySet>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _iterator_IPropertySet(py::wrapper::Windows::Foundation::Collections::IPropertySet* self) noexcept
    {
        try
        {
            py::pyobj_handle iter{py::convert(self->obj.First())};
            return py::wrap_mapping_iter(iter.get());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int _map_contains_IPropertySet(py::wrapper::Windows::Foundation::Collections::IPropertySet* 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_IPropertySet(py::wrapper::Windows::Foundation::Collections::IPropertySet* self) noexcept
    {
        try
        {
            return static_cast<Py_ssize_t>(self->obj.Size());
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* _map_subscript_IPropertySet(py::wrapper::Windows::Foundation::Collections::IPropertySet* self, PyObject* key) noexcept
    {
        try
        {
            auto value = self->obj.TryLookup(py::convert_to<winrt::hstring>(key));

            if (!value) {
                PyErr_SetObject(PyExc_KeyError, key);
                return nullptr;
            }

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

    static int _map_assign_IPropertySet(py::wrapper::Windows::Foundation::Collections::IPropertySet* 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::IInspectable>(value));

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

    static PyMethodDef _methods_IPropertySet[] = {
        { "clear", reinterpret_cast<PyCFunction>(IPropertySet_Clear), METH_VARARGS, nullptr },
        { "first", reinterpret_cast<PyCFunction>(IPropertySet_First), METH_VARARGS, nullptr },
        { "get_view", reinterpret_cast<PyCFunction>(IPropertySet_GetView), METH_VARARGS, nullptr },
        { "has_key", reinterpret_cast<PyCFunction>(IPropertySet_HasKey), METH_VARARGS, nullptr },
        { "insert", reinterpret_cast<PyCFunction>(IPropertySet_Insert), METH_VARARGS, nullptr },
        { "lookup", reinterpret_cast<PyCFunction>(IPropertySet_Lookup), METH_VARARGS, nullptr },
        { "remove", reinterpret_cast<PyCFunction>(IPropertySet_Remove), METH_VARARGS, nullptr },
        { "add_map_changed", reinterpret_cast<PyCFunction>(IPropertySet_add_MapChanged), METH_O, nullptr },
        { "remove_map_changed", reinterpret_cast<PyCFunction>(IPropertySet_remove_MapChanged), METH_O, nullptr },
        { "_assign_array_", _assign_array_IPropertySet, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_IPropertySet), METH_O | METH_STATIC, nullptr },
        { }
    };

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

    static PyType_Slot _type_slots_IPropertySet[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_IPropertySet) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IPropertySet) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IPropertySet) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IPropertySet) },
        { Py_tp_iter, reinterpret_cast<void*>(_iterator_IPropertySet) },
        { Py_sq_contains, reinterpret_cast<void*>(_map_contains_IPropertySet) },
        { Py_mp_length, reinterpret_cast<void*>(_map_length_IPropertySet) },
        { Py_mp_subscript, reinterpret_cast<void*>(_map_subscript_IPropertySet) },
        { Py_mp_ass_subscript, reinterpret_cast<void*>(_map_assign_IPropertySet) },
        { },
    };

    static PyType_Spec type_spec_IPropertySet =
    {
        "_winsdk_Windows_Foundation_Collections.IPropertySet",
        sizeof(py::wrapper::Windows::Foundation::Collections::IPropertySet),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_IPropertySet
    };

    // ----- IVectorChangedEventArgs interface --------------------
    static constexpr const char* const type_name_IVectorChangedEventArgs = "IVectorChangedEventArgs";

    static PyObject* _new_IVectorChangedEventArgs(PyTypeObject* /* unused */, PyObject* /* unused */, PyObject* /* unused */) noexcept
    {
        py::set_invalid_activation_error(type_name_IVectorChangedEventArgs);
        return nullptr;
    }

    static void _dealloc_IVectorChangedEventArgs(py::wrapper::Windows::Foundation::Collections::IVectorChangedEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* IVectorChangedEventArgs_get_CollectionChange(py::wrapper::Windows::Foundation::Collections::IVectorChangedEventArgs* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Foundation.Collections.IVectorChangedEventArgs", L"CollectionChange"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* IVectorChangedEventArgs_get_Index(py::wrapper::Windows::Foundation::Collections::IVectorChangedEventArgs* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Foundation.Collections.IVectorChangedEventArgs", L"Index"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

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

    static PyObject* _from_IVectorChangedEventArgs(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::Foundation::Collections::IVectorChangedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_IVectorChangedEventArgs[] = {
        { "_assign_array_", _assign_array_IVectorChangedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_IVectorChangedEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_IVectorChangedEventArgs[] = {
        { "collection_change", reinterpret_cast<getter>(IVectorChangedEventArgs_get_CollectionChange), nullptr, nullptr, nullptr },
        { "index", reinterpret_cast<getter>(IVectorChangedEventArgs_get_Index), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_IVectorChangedEventArgs[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_IVectorChangedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IVectorChangedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IVectorChangedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IVectorChangedEventArgs) },
        { },
    };

    static PyType_Spec type_spec_IVectorChangedEventArgs =
    {
        "_winsdk_Windows_Foundation_Collections.IVectorChangedEventArgs",
        sizeof(py::wrapper::Windows::Foundation::Collections::IVectorChangedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_IVectorChangedEventArgs
    };

    // ----- IVectorView interface --------------------
    static constexpr const char* const type_name_IVectorView = "IVectorView";

    static PyObject* _new_IVectorView(PyTypeObject* /* unused */, PyObject* /* unused */, PyObject* /* unused */) noexcept
    {
        py::set_invalid_activation_error(type_name_IVectorView);
        return nullptr;
    }

    static void _dealloc_IVectorView(py::wrapper::Windows::Foundation::Collections::IVectorView* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* IVectorView_First(py::wrapper::Windows::Foundation::Collections::IVectorView* self, PyObject* args) noexcept
    {
        return self->obj->First(args);
    }

    static PyObject* IVectorView_GetAt(py::wrapper::Windows::Foundation::Collections::IVectorView* self, PyObject* args) noexcept
    {
        return self->obj->GetAt(args);
    }

    static PyObject* IVectorView_GetMany(py::wrapper::Windows::Foundation::Collections::IVectorView* self, PyObject* args) noexcept
    {
        return self->obj->GetMany(args);
    }

    static PyObject* IVectorView_IndexOf(py::wrapper::Windows::Foundation::Collections::IVectorView* self, PyObject* args) noexcept
    {
        return self->obj->IndexOf(args);
    }

    static PyObject* IVectorView_get_Size(py::wrapper::Windows::Foundation::Collections::IVectorView* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Foundation.Collections.IVectorView`1", L"Size"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        return self->obj->get_Size();
    }

    static PyObject* _iterator_IVectorView(py::wrapper::Windows::Foundation::Collections::IVectorView* self) noexcept
    {
        return self->obj->dunder_iter();
    }

    static Py_ssize_t _seq_length_IVectorView(py::wrapper::Windows::Foundation::Collections::IVectorView* self) noexcept
    {
        return self->obj->seq_length();
    }

    static PyObject* _seq_item_IVectorView(py::wrapper::Windows::Foundation::Collections::IVectorView* self, Py_ssize_t i) noexcept
    {
        return self->obj->seq_item(i);
    }

    static PyObject* _seq_subscript_IVectorView(py::wrapper::Windows::Foundation::Collections::IVectorView* self, PyObject* slice) noexcept
    {
        return self->obj->seq_subscript(slice);
    }

    static PyMethodDef _methods_IVectorView[] = {
        { "first", reinterpret_cast<PyCFunction>(IVectorView_First), METH_VARARGS, nullptr },
        { "get_at", reinterpret_cast<PyCFunction>(IVectorView_GetAt), METH_VARARGS, nullptr },
        { "get_many", reinterpret_cast<PyCFunction>(IVectorView_GetMany), METH_VARARGS, nullptr },
        { "index_of", reinterpret_cast<PyCFunction>(IVectorView_IndexOf), METH_VARARGS, nullptr },
        #if PY_VERSION_HEX >= 0x03090000
        { "__class_getitem__", Py_GenericAlias, METH_O | METH_CLASS, PyDoc_STR("See PEP 585") },
        #endif
        { }
    };

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

    static PyType_Slot _type_slots_IVectorView[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_IVectorView) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IVectorView) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IVectorView) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IVectorView) },
        { Py_tp_iter, reinterpret_cast<void*>(_iterator_IVectorView) },
        { Py_sq_length, reinterpret_cast<void*>(_seq_length_IVectorView) },
        { Py_sq_item, reinterpret_cast<void*>(_seq_item_IVectorView) },
        { Py_mp_subscript, reinterpret_cast<void*>(_seq_subscript_IVectorView) },
        { },
    };

    static PyType_Spec type_spec_IVectorView =
    {
        "_winsdk_Windows_Foundation_Collections.IVectorView",
        sizeof(py::wrapper::Windows::Foundation::Collections::IVectorView),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_IVectorView
    };

    // ----- IVector interface --------------------
    static constexpr const char* const type_name_IVector = "IVector";

    static PyObject* _new_IVector(PyTypeObject* /* unused */, PyObject* /* unused */, PyObject* /* unused */) noexcept
    {
        py::set_invalid_activation_error(type_name_IVector);
        return nullptr;
    }

    static void _dealloc_IVector(py::wrapper::Windows::Foundation::Collections::IVector* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* IVector_Append(py::wrapper::Windows::Foundation::Collections::IVector* self, PyObject* args) noexcept
    {
        return self->obj->Append(args);
    }

    static PyObject* IVector_Clear(py::wrapper::Windows::Foundation::Collections::IVector* self, PyObject* args) noexcept
    {
        return self->obj->Clear(args);
    }

    static PyObject* IVector_First(py::wrapper::Windows::Foundation::Collections::IVector* self, PyObject* args) noexcept
    {
        return self->obj->First(args);
    }

    static PyObject* IVector_GetAt(py::wrapper::Windows::Foundation::Collections::IVector* self, PyObject* args) noexcept
    {
        return self->obj->GetAt(args);
    }

    static PyObject* IVector_GetMany(py::wrapper::Windows::Foundation::Collections::IVector* self, PyObject* args) noexcept
    {
        return self->obj->GetMany(args);
    }

    static PyObject* IVector_GetView(py::wrapper::Windows::Foundation::Collections::IVector* self, PyObject* args) noexcept
    {
        return self->obj->GetView(args);
    }

    static PyObject* IVector_IndexOf(py::wrapper::Windows::Foundation::Collections::IVector* self, PyObject* args) noexcept
    {
        return self->obj->IndexOf(args);
    }

    static PyObject* IVector_InsertAt(py::wrapper::Windows::Foundation::Collections::IVector* self, PyObject* args) noexcept
    {
        return self->obj->InsertAt(args);
    }

    static PyObject* IVector_RemoveAt(py::wrapper::Windows::Foundation::Collections::IVector* self, PyObject* args) noexcept
    {
        return self->obj->RemoveAt(args);
    }

    static PyObject* IVector_RemoveAtEnd(py::wrapper::Windows::Foundation::Collections::IVector* self, PyObject* args) noexcept
    {
        return self->obj->RemoveAtEnd(args);
    }

    static PyObject* IVector_ReplaceAll(py::wrapper::Windows::Foundation::Collections::IVector* self, PyObject* args) noexcept
    {
        return self->obj->ReplaceAll(args);
    }

    static PyObject* IVector_SetAt(py::wrapper::Windows::Foundation::Collections::IVector* self, PyObject* args) noexcept
    {
        return self->obj->SetAt(args);
    }

    static PyObject* IVector_get_Size(py::wrapper::Windows::Foundation::Collections::IVector* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Foundation.Collections.IVector`1", L"Size"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        return self->obj->get_Size();
    }

    static PyObject* _iterator_IVector(py::wrapper::Windows::Foundation::Collections::IVector* self) noexcept
    {
        return self->obj->dunder_iter();
    }

    static Py_ssize_t _seq_length_IVector(py::wrapper::Windows::Foundation::Collections::IVector* self) noexcept
    {
        return self->obj->seq_length();
    }

    static PyObject* _seq_item_IVector(py::wrapper::Windows::Foundation::Collections::IVector* self, Py_ssize_t i) noexcept
    {
        return self->obj->seq_item(i);
    }

    static PyObject* _seq_subscript_IVector(py::wrapper::Windows::Foundation::Collections::IVector* self, PyObject* slice) noexcept
    {
        return self->obj->seq_subscript(slice);
    }

    static int _seq_assign_IVector(py::wrapper::Windows::Foundation::Collections::IVector* self, Py_ssize_t i, PyObject* value) noexcept
    {
        return self->obj->seq_assign(i, value);
    }

    static PyObject* IVector_get_insert(PyObject* self) noexcept
    {
        return PyObject_GetAttrString(self, "insert_at");
    }

    static PyMethodDef _methods_IVector[] = {
        { "append", reinterpret_cast<PyCFunction>(IVector_Append), METH_VARARGS, nullptr },
        { "clear", reinterpret_cast<PyCFunction>(IVector_Clear), METH_VARARGS, nullptr },
        { "first", reinterpret_cast<PyCFunction>(IVector_First), METH_VARARGS, nullptr },
        { "get_at", reinterpret_cast<PyCFunction>(IVector_GetAt), METH_VARARGS, nullptr },
        { "get_many", reinterpret_cast<PyCFunction>(IVector_GetMany), METH_VARARGS, nullptr },
        { "get_view", reinterpret_cast<PyCFunction>(IVector_GetView), METH_VARARGS, nullptr },
        { "index_of", reinterpret_cast<PyCFunction>(IVector_IndexOf), METH_VARARGS, nullptr },
        { "insert_at", reinterpret_cast<PyCFunction>(IVector_InsertAt), METH_VARARGS, nullptr },
        { "remove_at", reinterpret_cast<PyCFunction>(IVector_RemoveAt), METH_VARARGS, nullptr },
        { "remove_at_end", reinterpret_cast<PyCFunction>(IVector_RemoveAtEnd), METH_VARARGS, nullptr },
        { "replace_all", reinterpret_cast<PyCFunction>(IVector_ReplaceAll), METH_VARARGS, nullptr },
        { "set_at", reinterpret_cast<PyCFunction>(IVector_SetAt), METH_VARARGS, nullptr },
        #if PY_VERSION_HEX >= 0x03090000
        { "__class_getitem__", Py_GenericAlias, METH_O | METH_CLASS, PyDoc_STR("See PEP 585") },
        #endif
        { }
    };

    static PyGetSetDef _getset_IVector[] = {
        { "size", reinterpret_cast<getter>(IVector_get_Size), nullptr, nullptr, nullptr },
        { "insert", reinterpret_cast<getter>(IVector_get_insert), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_IVector[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_IVector) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IVector) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IVector) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IVector) },
        { Py_tp_iter, reinterpret_cast<void*>(_iterator_IVector) },
        { Py_sq_length, reinterpret_cast<void*>(_seq_length_IVector) },
        { Py_sq_item, reinterpret_cast<void*>(_seq_item_IVector) },
        { Py_mp_subscript, reinterpret_cast<void*>(_seq_subscript_IVector) },
        { Py_sq_ass_item, reinterpret_cast<void*>(_seq_assign_IVector) },
        { },
    };

    static PyType_Spec type_spec_IVector =
    {
        "_winsdk_Windows_Foundation_Collections.IVector",
        sizeof(py::wrapper::Windows::Foundation::Collections::IVector),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_IVector
    };

    // ----- Windows.Foundation.Collections Initialization --------------------
    PyDoc_STRVAR(module_doc, "Windows::Foundation::Collections");

    static PyMethodDef module_methods[] = {
        {"_register_CollectionChange", register_CollectionChange, METH_O, "registers type"},
        {}};


    static int module_traverse(PyObject* module, visitproc visit, void* arg) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));

        if (!state)
        {
            return 0;
        }

        Py_VISIT(state->type_CollectionChange);
        Py_VISIT(state->type_PropertySet);
        Py_VISIT(state->type_StringMap);
        Py_VISIT(state->type_ValueSet);
        Py_VISIT(state->type_IIterable);
        Py_VISIT(state->type_IIterator);
        Py_VISIT(state->type_IKeyValuePair);
        Py_VISIT(state->type_IMapChangedEventArgs);
        Py_VISIT(state->type_IMapView);
        Py_VISIT(state->type_IMap);
        Py_VISIT(state->type_IObservableMap);
        Py_VISIT(state->type_IObservableVector);
        Py_VISIT(state->type_IPropertySet);
        Py_VISIT(state->type_IVectorChangedEventArgs);
        Py_VISIT(state->type_IVectorView);
        Py_VISIT(state->type_IVector);

        return 0;
    }

    static int module_clear(PyObject* module) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));

        if (!state)
        {
            return 0;
        }

        Py_CLEAR(state->type_CollectionChange);
        Py_CLEAR(state->type_PropertySet);
        Py_CLEAR(state->type_StringMap);
        Py_CLEAR(state->type_ValueSet);
        Py_CLEAR(state->type_IIterable);
        Py_CLEAR(state->type_IIterator);
        Py_CLEAR(state->type_IKeyValuePair);
        Py_CLEAR(state->type_IMapChangedEventArgs);
        Py_CLEAR(state->type_IMapView);
        Py_CLEAR(state->type_IMap);
        Py_CLEAR(state->type_IObservableMap);
        Py_CLEAR(state->type_IObservableVector);
        Py_CLEAR(state->type_IPropertySet);
        Py_CLEAR(state->type_IVectorChangedEventArgs);
        Py_CLEAR(state->type_IVectorView);
        Py_CLEAR(state->type_IVector);

        return 0;
    }


    static PyModuleDef module_def
        = {PyModuleDef_HEAD_INIT,
           "_winsdk_Windows_Foundation_Collections",
           module_doc,
           sizeof(module_state),
           module_methods,
           nullptr,
           module_traverse,
           module_clear,
           nullptr};

} // py::cpp::Windows::Foundation::Collections

PyMODINIT_FUNC PyInit__winsdk_Windows_Foundation_Collections(void) noexcept
{
    using namespace py::cpp::Windows::Foundation::Collections;

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

    if (!module)
    {
        return nullptr;
    }

    auto object_type = py::get_python_type<py::Object>();
    if (!object_type)
    {
        return nullptr;
    }

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

    if (!bases)
    {
        return nullptr;
    }

    py::pyobj_handle collections_abc_module{PyImport_ImportModule("collections.abc")};

    if (!collections_abc_module)
    {
        return nullptr;
    }

    py::pyobj_handle sequence_type{PyObject_GetAttrString(collections_abc_module.get(), "Sequence")};

    if (!sequence_type)
    {
        return nullptr;
    }

    py::pyobj_handle sequence_bases{PyTuple_Pack(2, object_type, sequence_type.get())};

    if (!sequence_bases)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_sequence_type{PyObject_GetAttrString(collections_abc_module.get(), "MutableSequence")};

    if (!mutable_sequence_type)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_sequence_bases{PyTuple_Pack(2, object_type, mutable_sequence_type.get())};

    if (!mutable_sequence_bases)
    {
        return nullptr;
    }

    py::pyobj_handle mapping_type{PyObject_GetAttrString(collections_abc_module.get(), "Mapping")};

    if (!mapping_type)
    {
        return nullptr;
    }

    py::pyobj_handle mapping_bases{PyTuple_Pack(2, object_type, mapping_type.get())};

    if (!mapping_bases)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_mapping_type{PyObject_GetAttrString(collections_abc_module.get(), "MutableMapping")};

    if (!mutable_mapping_type)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_mapping_bases{PyTuple_Pack(2, object_type, mutable_mapping_type.get())};

    if (!mutable_mapping_bases)
    {
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module.get()));
    assert(state);

    state->type_PropertySet = py::register_python_type(module.get(), type_name_PropertySet, &type_spec_PropertySet, mutable_mapping_bases.get(), nullptr);
    if (!state->type_PropertySet)
    {
        return nullptr;
    }

    state->type_StringMap = py::register_python_type(module.get(), type_name_StringMap, &type_spec_StringMap, mutable_mapping_bases.get(), nullptr);
    if (!state->type_StringMap)
    {
        return nullptr;
    }

    state->type_ValueSet = py::register_python_type(module.get(), type_name_ValueSet, &type_spec_ValueSet, mutable_mapping_bases.get(), nullptr);
    if (!state->type_ValueSet)
    {
        return nullptr;
    }

    state->type_IIterable = py::register_python_type(module.get(), type_name_IIterable, &type_spec_IIterable, bases.get(), nullptr);
    if (!state->type_IIterable)
    {
        return nullptr;
    }

    state->type_IIterator = py::register_python_type(module.get(), type_name_IIterator, &type_spec_IIterator, bases.get(), nullptr);
    if (!state->type_IIterator)
    {
        return nullptr;
    }

    state->type_IKeyValuePair = py::register_python_type(module.get(), type_name_IKeyValuePair, &type_spec_IKeyValuePair, bases.get(), nullptr);
    if (!state->type_IKeyValuePair)
    {
        return nullptr;
    }

    state->type_IMapChangedEventArgs = py::register_python_type(module.get(), type_name_IMapChangedEventArgs, &type_spec_IMapChangedEventArgs, bases.get(), nullptr);
    if (!state->type_IMapChangedEventArgs)
    {
        return nullptr;
    }

    state->type_IMapView = py::register_python_type(module.get(), type_name_IMapView, &type_spec_IMapView, mapping_bases.get(), nullptr);
    if (!state->type_IMapView)
    {
        return nullptr;
    }

    state->type_IMap = py::register_python_type(module.get(), type_name_IMap, &type_spec_IMap, mutable_mapping_bases.get(), nullptr);
    if (!state->type_IMap)
    {
        return nullptr;
    }

    state->type_IObservableMap = py::register_python_type(module.get(), type_name_IObservableMap, &type_spec_IObservableMap, mutable_mapping_bases.get(), nullptr);
    if (!state->type_IObservableMap)
    {
        return nullptr;
    }

    state->type_IObservableVector = py::register_python_type(module.get(), type_name_IObservableVector, &type_spec_IObservableVector, mutable_sequence_bases.get(), nullptr);
    if (!state->type_IObservableVector)
    {
        return nullptr;
    }

    state->type_IPropertySet = py::register_python_type(module.get(), type_name_IPropertySet, &type_spec_IPropertySet, mutable_mapping_bases.get(), nullptr);
    if (!state->type_IPropertySet)
    {
        return nullptr;
    }

    state->type_IVectorChangedEventArgs = py::register_python_type(module.get(), type_name_IVectorChangedEventArgs, &type_spec_IVectorChangedEventArgs, bases.get(), nullptr);
    if (!state->type_IVectorChangedEventArgs)
    {
        return nullptr;
    }

    state->type_IVectorView = py::register_python_type(module.get(), type_name_IVectorView, &type_spec_IVectorView, sequence_bases.get(), nullptr);
    if (!state->type_IVectorView)
    {
        return nullptr;
    }

    state->type_IVector = py::register_python_type(module.get(), type_name_IVector, &type_spec_IVector, mutable_sequence_bases.get(), nullptr);
    if (!state->type_IVector)
    {
        return nullptr;
    }


    return module.detach();
}

PyObject* py::py_type<winrt::Windows::Foundation::Collections::CollectionChange>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Foundation::Collections;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Foundation::Collections");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_CollectionChange;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Foundation::Collections::CollectionChange is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Foundation::Collections::PropertySet>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Foundation::Collections;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Foundation::Collections");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_PropertySet;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Foundation::Collections::PropertySet is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Foundation::Collections::StringMap>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Foundation::Collections;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Foundation::Collections");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_StringMap;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Foundation::Collections::StringMap is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Foundation::Collections::ValueSet>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Foundation::Collections;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Foundation::Collections");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_ValueSet;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Foundation::Collections::ValueSet is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<py::proj::Windows::Foundation::Collections::IIterable>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Foundation::Collections;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Foundation::Collections");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_IIterable;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type py::proj::Windows::Foundation::Collections::IIterable is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<py::proj::Windows::Foundation::Collections::IIterator>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Foundation::Collections;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Foundation::Collections");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_IIterator;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type py::proj::Windows::Foundation::Collections::IIterator is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<py::proj::Windows::Foundation::Collections::IKeyValuePair>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Foundation::Collections;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Foundation::Collections");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_IKeyValuePair;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type py::proj::Windows::Foundation::Collections::IKeyValuePair is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<py::proj::Windows::Foundation::Collections::IMapChangedEventArgs>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Foundation::Collections;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Foundation::Collections");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_IMapChangedEventArgs;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type py::proj::Windows::Foundation::Collections::IMapChangedEventArgs is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<py::proj::Windows::Foundation::Collections::IMapView>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Foundation::Collections;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Foundation::Collections");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_IMapView;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type py::proj::Windows::Foundation::Collections::IMapView is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<py::proj::Windows::Foundation::Collections::IMap>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Foundation::Collections;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Foundation::Collections");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_IMap;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type py::proj::Windows::Foundation::Collections::IMap is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<py::proj::Windows::Foundation::Collections::IObservableMap>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Foundation::Collections;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Foundation::Collections");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_IObservableMap;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type py::proj::Windows::Foundation::Collections::IObservableMap is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<py::proj::Windows::Foundation::Collections::IObservableVector>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Foundation::Collections;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Foundation::Collections");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_IObservableVector;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type py::proj::Windows::Foundation::Collections::IObservableVector is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Foundation::Collections::IPropertySet>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Foundation::Collections;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Foundation::Collections");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_IPropertySet;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Foundation::Collections::IPropertySet is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Foundation::Collections::IVectorChangedEventArgs>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Foundation::Collections;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Foundation::Collections");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_IVectorChangedEventArgs;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Foundation::Collections::IVectorChangedEventArgs is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<py::proj::Windows::Foundation::Collections::IVectorView>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Foundation::Collections;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Foundation::Collections");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_IVectorView;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type py::proj::Windows::Foundation::Collections::IVectorView is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<py::proj::Windows::Foundation::Collections::IVector>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Foundation::Collections;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Foundation::Collections");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_IVector;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type py::proj::Windows::Foundation::Collections::IVector is not registered");
        return nullptr;
    }

    return python_type;
}
