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

#include "pybase.h"
#include "py.Windows.Perception.Spatial.h"


PyObject* py::converter<winrt::Windows::Perception::Spatial::SpatialBoundingBox>::convert(winrt::Windows::Perception::Spatial::SpatialBoundingBox instance) noexcept
{
    auto type = py::get_python_type<winrt::Windows::Perception::Spatial::SpatialBoundingBox>();
    if (!type)
    {
        return nullptr;
    }

    return py::wrap_struct(instance, type);
}
winrt::Windows::Perception::Spatial::SpatialBoundingBox py::converter<winrt::Windows::Perception::Spatial::SpatialBoundingBox>::convert_to(PyObject* obj)
{
    throw_if_pyobj_null(obj);

    auto type =  py::get_python_type<winrt::Windows::Perception::Spatial::SpatialBoundingBox>();

    if (!type) {
        throw python_exception();
    }

    if (Py_TYPE(obj) == type)
    {
        return reinterpret_cast<py::winrt_struct_wrapper<winrt::Windows::Perception::Spatial::SpatialBoundingBox>*>(obj)->obj;
    }

    PyErr_SetString(PyExc_TypeError, "expecting winrt::Windows::Perception::Spatial::SpatialBoundingBox");
    throw python_exception();
}

PyObject* py::converter<winrt::Windows::Perception::Spatial::SpatialBoundingFrustum>::convert(winrt::Windows::Perception::Spatial::SpatialBoundingFrustum instance) noexcept
{
    auto type = py::get_python_type<winrt::Windows::Perception::Spatial::SpatialBoundingFrustum>();
    if (!type)
    {
        return nullptr;
    }

    return py::wrap_struct(instance, type);
}
winrt::Windows::Perception::Spatial::SpatialBoundingFrustum py::converter<winrt::Windows::Perception::Spatial::SpatialBoundingFrustum>::convert_to(PyObject* obj)
{
    throw_if_pyobj_null(obj);

    auto type =  py::get_python_type<winrt::Windows::Perception::Spatial::SpatialBoundingFrustum>();

    if (!type) {
        throw python_exception();
    }

    if (Py_TYPE(obj) == type)
    {
        return reinterpret_cast<py::winrt_struct_wrapper<winrt::Windows::Perception::Spatial::SpatialBoundingFrustum>*>(obj)->obj;
    }

    PyErr_SetString(PyExc_TypeError, "expecting winrt::Windows::Perception::Spatial::SpatialBoundingFrustum");
    throw python_exception();
}

PyObject* py::converter<winrt::Windows::Perception::Spatial::SpatialBoundingOrientedBox>::convert(winrt::Windows::Perception::Spatial::SpatialBoundingOrientedBox instance) noexcept
{
    auto type = py::get_python_type<winrt::Windows::Perception::Spatial::SpatialBoundingOrientedBox>();
    if (!type)
    {
        return nullptr;
    }

    return py::wrap_struct(instance, type);
}
winrt::Windows::Perception::Spatial::SpatialBoundingOrientedBox py::converter<winrt::Windows::Perception::Spatial::SpatialBoundingOrientedBox>::convert_to(PyObject* obj)
{
    throw_if_pyobj_null(obj);

    auto type =  py::get_python_type<winrt::Windows::Perception::Spatial::SpatialBoundingOrientedBox>();

    if (!type) {
        throw python_exception();
    }

    if (Py_TYPE(obj) == type)
    {
        return reinterpret_cast<py::winrt_struct_wrapper<winrt::Windows::Perception::Spatial::SpatialBoundingOrientedBox>*>(obj)->obj;
    }

    PyErr_SetString(PyExc_TypeError, "expecting winrt::Windows::Perception::Spatial::SpatialBoundingOrientedBox");
    throw python_exception();
}

PyObject* py::converter<winrt::Windows::Perception::Spatial::SpatialBoundingSphere>::convert(winrt::Windows::Perception::Spatial::SpatialBoundingSphere instance) noexcept
{
    auto type = py::get_python_type<winrt::Windows::Perception::Spatial::SpatialBoundingSphere>();
    if (!type)
    {
        return nullptr;
    }

    return py::wrap_struct(instance, type);
}
winrt::Windows::Perception::Spatial::SpatialBoundingSphere py::converter<winrt::Windows::Perception::Spatial::SpatialBoundingSphere>::convert_to(PyObject* obj)
{
    throw_if_pyobj_null(obj);

    auto type =  py::get_python_type<winrt::Windows::Perception::Spatial::SpatialBoundingSphere>();

    if (!type) {
        throw python_exception();
    }

    if (Py_TYPE(obj) == type)
    {
        return reinterpret_cast<py::winrt_struct_wrapper<winrt::Windows::Perception::Spatial::SpatialBoundingSphere>*>(obj)->obj;
    }

    PyErr_SetString(PyExc_TypeError, "expecting winrt::Windows::Perception::Spatial::SpatialBoundingSphere");
    throw python_exception();
}

PyObject* py::converter<winrt::Windows::Perception::Spatial::SpatialRay>::convert(winrt::Windows::Perception::Spatial::SpatialRay instance) noexcept
{
    auto type = py::get_python_type<winrt::Windows::Perception::Spatial::SpatialRay>();
    if (!type)
    {
        return nullptr;
    }

    return py::wrap_struct(instance, type);
}
winrt::Windows::Perception::Spatial::SpatialRay py::converter<winrt::Windows::Perception::Spatial::SpatialRay>::convert_to(PyObject* obj)
{
    throw_if_pyobj_null(obj);

    auto type =  py::get_python_type<winrt::Windows::Perception::Spatial::SpatialRay>();

    if (!type) {
        throw python_exception();
    }

    if (Py_TYPE(obj) == type)
    {
        return reinterpret_cast<py::winrt_struct_wrapper<winrt::Windows::Perception::Spatial::SpatialRay>*>(obj)->obj;
    }

    PyErr_SetString(PyExc_TypeError, "expecting winrt::Windows::Perception::Spatial::SpatialRay");
    throw python_exception();
}

namespace py::cpp::Windows::Perception::Spatial
{
    struct module_state
    {
        PyObject* type_SpatialAnchorExportPurpose;
        PyObject* type_SpatialEntityWatcherStatus;
        PyObject* type_SpatialLocatability;
        PyObject* type_SpatialLookDirectionRange;
        PyObject* type_SpatialMovementRange;
        PyObject* type_SpatialPerceptionAccessStatus;
        PyTypeObject* type_SpatialAnchor;
        PyTypeObject* type_SpatialAnchorExportSufficiency;
        PyTypeObject* type_SpatialAnchorExporter;
        PyTypeObject* type_SpatialAnchorManager;
        PyTypeObject* type_SpatialAnchorRawCoordinateSystemAdjustedEventArgs;
        PyTypeObject* type_SpatialAnchorStore;
        PyTypeObject* type_SpatialAnchorTransferManager;
        PyTypeObject* type_SpatialBoundingVolume;
        PyTypeObject* type_SpatialCoordinateSystem;
        PyTypeObject* type_SpatialEntity;
        PyTypeObject* type_SpatialEntityAddedEventArgs;
        PyTypeObject* type_SpatialEntityRemovedEventArgs;
        PyTypeObject* type_SpatialEntityStore;
        PyTypeObject* type_SpatialEntityUpdatedEventArgs;
        PyTypeObject* type_SpatialEntityWatcher;
        PyTypeObject* type_SpatialLocation;
        PyTypeObject* type_SpatialLocator;
        PyTypeObject* type_SpatialLocatorAttachedFrameOfReference;
        PyTypeObject* type_SpatialLocatorPositionalTrackingDeactivatingEventArgs;
        PyTypeObject* type_SpatialStageFrameOfReference;
        PyTypeObject* type_SpatialStationaryFrameOfReference;
        PyTypeObject* type_SpatialBoundingBox;
        PyTypeObject* type_SpatialBoundingFrustum;
        PyTypeObject* type_SpatialBoundingOrientedBox;
        PyTypeObject* type_SpatialBoundingSphere;
        PyTypeObject* type_SpatialRay;
    };

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

        if (state->type_SpatialAnchorExportPurpose)
        {
            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_SpatialAnchorExportPurpose = type;
        Py_INCREF(state->type_SpatialAnchorExportPurpose);


        Py_RETURN_NONE;
    }

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

        if (state->type_SpatialEntityWatcherStatus)
        {
            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_SpatialEntityWatcherStatus = type;
        Py_INCREF(state->type_SpatialEntityWatcherStatus);


        Py_RETURN_NONE;
    }

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

        if (state->type_SpatialLocatability)
        {
            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_SpatialLocatability = type;
        Py_INCREF(state->type_SpatialLocatability);


        Py_RETURN_NONE;
    }

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

        if (state->type_SpatialLookDirectionRange)
        {
            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_SpatialLookDirectionRange = type;
        Py_INCREF(state->type_SpatialLookDirectionRange);


        Py_RETURN_NONE;
    }

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

        if (state->type_SpatialMovementRange)
        {
            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_SpatialMovementRange = type;
        Py_INCREF(state->type_SpatialMovementRange);


        Py_RETURN_NONE;
    }

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

        if (state->type_SpatialPerceptionAccessStatus)
        {
            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_SpatialPerceptionAccessStatus = type;
        Py_INCREF(state->type_SpatialPerceptionAccessStatus);


        Py_RETURN_NONE;
    }

    // ----- SpatialAnchor class --------------------
    static constexpr const char* const type_name_SpatialAnchor = "SpatialAnchor";

    static PyObject* _new_SpatialAnchor(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialAnchor);
        return nullptr;
    }

    static void _dealloc_SpatialAnchor(py::wrapper::Windows::Perception::Spatial::SpatialAnchor* 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* SpatialAnchor_TryCreateRelativeTo(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialAnchor", L"TryCreateRelativeTo", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialCoordinateSystem>(args, 0);

                return py::convert(winrt::Windows::Perception::Spatial::SpatialAnchor::TryCreateRelativeTo(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialAnchor", L"TryCreateRelativeTo", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialCoordinateSystem>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::Numerics::float3>(args, 1);

                return py::convert(winrt::Windows::Perception::Spatial::SpatialAnchor::TryCreateRelativeTo(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 3)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialAnchor", L"TryCreateRelativeTo", 3))
            {
                py::set_arg_count_version_error(3);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialCoordinateSystem>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::Numerics::float3>(args, 1);
                auto param2 = py::convert_to<winrt::Windows::Foundation::Numerics::quaternion>(args, 2);

                return py::convert(winrt::Windows::Perception::Spatial::SpatialAnchor::TryCreateRelativeTo(param0, param1, param2));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

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

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

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

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

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

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

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Perception::Spatial::SpatialAnchor, winrt::Windows::Perception::Spatial::SpatialAnchorRawCoordinateSystemAdjustedEventArgs>>(arg);

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

    static PyObject* SpatialAnchor_remove_RawCoordinateSystemAdjusted(py::wrapper::Windows::Perception::Spatial::SpatialAnchor* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Perception.Spatial.SpatialAnchor", L"RawCoordinateSystemAdjusted"))
        {
            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.RawCoordinateSystemAdjusted(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_SpatialAnchor(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::Perception::Spatial::SpatialAnchor>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialAnchor[] = {
        { "try_create_relative_to", reinterpret_cast<PyCFunction>(SpatialAnchor_TryCreateRelativeTo), METH_VARARGS | METH_STATIC, nullptr },
        { "add_raw_coordinate_system_adjusted", reinterpret_cast<PyCFunction>(SpatialAnchor_add_RawCoordinateSystemAdjusted), METH_O, nullptr },
        { "remove_raw_coordinate_system_adjusted", reinterpret_cast<PyCFunction>(SpatialAnchor_remove_RawCoordinateSystemAdjusted), METH_O, nullptr },
        { "_assign_array_", _assign_array_SpatialAnchor, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SpatialAnchor), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialAnchor[] = {
        { "coordinate_system", reinterpret_cast<getter>(SpatialAnchor_get_CoordinateSystem), nullptr, nullptr, nullptr },
        { "raw_coordinate_system", reinterpret_cast<getter>(SpatialAnchor_get_RawCoordinateSystem), nullptr, nullptr, nullptr },
        { "removed_by_user", reinterpret_cast<getter>(SpatialAnchor_get_RemovedByUser), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SpatialAnchor[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialAnchor) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialAnchor) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialAnchor) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialAnchor) },
        { },
    };

    static PyType_Spec type_spec_SpatialAnchor =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialAnchor",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialAnchor),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialAnchor
    };

    // ----- SpatialAnchorExportSufficiency class --------------------
    static constexpr const char* const type_name_SpatialAnchorExportSufficiency = "SpatialAnchorExportSufficiency";

    static PyObject* _new_SpatialAnchorExportSufficiency(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialAnchorExportSufficiency);
        return nullptr;
    }

    static void _dealloc_SpatialAnchorExportSufficiency(py::wrapper::Windows::Perception::Spatial::SpatialAnchorExportSufficiency* 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* SpatialAnchorExportSufficiency_get_IsMinimallySufficient(py::wrapper::Windows::Perception::Spatial::SpatialAnchorExportSufficiency* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Perception.Spatial.SpatialAnchorExportSufficiency", L"IsMinimallySufficient"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

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

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

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

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

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

    static PyObject* _from_SpatialAnchorExportSufficiency(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::Perception::Spatial::SpatialAnchorExportSufficiency>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialAnchorExportSufficiency[] = {
        { "_assign_array_", _assign_array_SpatialAnchorExportSufficiency, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SpatialAnchorExportSufficiency), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialAnchorExportSufficiency[] = {
        { "is_minimally_sufficient", reinterpret_cast<getter>(SpatialAnchorExportSufficiency_get_IsMinimallySufficient), nullptr, nullptr, nullptr },
        { "recommended_sufficiency_level", reinterpret_cast<getter>(SpatialAnchorExportSufficiency_get_RecommendedSufficiencyLevel), nullptr, nullptr, nullptr },
        { "sufficiency_level", reinterpret_cast<getter>(SpatialAnchorExportSufficiency_get_SufficiencyLevel), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SpatialAnchorExportSufficiency[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialAnchorExportSufficiency) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialAnchorExportSufficiency) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialAnchorExportSufficiency) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialAnchorExportSufficiency) },
        { },
    };

    static PyType_Spec type_spec_SpatialAnchorExportSufficiency =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialAnchorExportSufficiency",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialAnchorExportSufficiency),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialAnchorExportSufficiency
    };

    // ----- SpatialAnchorExporter class --------------------
    static constexpr const char* const type_name_SpatialAnchorExporter = "SpatialAnchorExporter";

    static PyObject* _new_SpatialAnchorExporter(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialAnchorExporter);
        return nullptr;
    }

    static void _dealloc_SpatialAnchorExporter(py::wrapper::Windows::Perception::Spatial::SpatialAnchorExporter* 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* SpatialAnchorExporter_GetAnchorExportSufficiencyAsync(py::wrapper::Windows::Perception::Spatial::SpatialAnchorExporter* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialAnchorExporter", L"GetAnchorExportSufficiencyAsync", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialAnchor>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialAnchorExportPurpose>(args, 1);

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

    static PyObject* SpatialAnchorExporter_GetDefault(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialAnchorExporter", L"GetDefault", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Perception::Spatial::SpatialAnchorExporter::GetDefault());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* SpatialAnchorExporter_RequestAccessAsync(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialAnchorExporter", L"RequestAccessAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Perception::Spatial::SpatialAnchorExporter::RequestAccessAsync());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* SpatialAnchorExporter_TryExportAnchorAsync(py::wrapper::Windows::Perception::Spatial::SpatialAnchorExporter* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 3)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialAnchorExporter", L"TryExportAnchorAsync", 3))
            {
                py::set_arg_count_version_error(3);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialAnchor>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialAnchorExportPurpose>(args, 1);
                auto param2 = py::convert_to<winrt::Windows::Storage::Streams::IOutputStream>(args, 2);

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

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

    static PyObject* _from_SpatialAnchorExporter(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::Perception::Spatial::SpatialAnchorExporter>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialAnchorExporter[] = {
        { "get_anchor_export_sufficiency_async", reinterpret_cast<PyCFunction>(SpatialAnchorExporter_GetAnchorExportSufficiencyAsync), METH_VARARGS, nullptr },
        { "get_default", reinterpret_cast<PyCFunction>(SpatialAnchorExporter_GetDefault), METH_VARARGS | METH_STATIC, nullptr },
        { "request_access_async", reinterpret_cast<PyCFunction>(SpatialAnchorExporter_RequestAccessAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "try_export_anchor_async", reinterpret_cast<PyCFunction>(SpatialAnchorExporter_TryExportAnchorAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_SpatialAnchorExporter, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SpatialAnchorExporter), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialAnchorExporter[] = {
        { }
    };

    static PyType_Slot _type_slots_SpatialAnchorExporter[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialAnchorExporter) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialAnchorExporter) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialAnchorExporter) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialAnchorExporter) },
        { },
    };

    static PyType_Spec type_spec_SpatialAnchorExporter =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialAnchorExporter",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialAnchorExporter),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialAnchorExporter
    };

    // ----- SpatialAnchorManager class --------------------
    static constexpr const char* const type_name_SpatialAnchorManager = "SpatialAnchorManager";

    static PyObject* _new_SpatialAnchorManager(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialAnchorManager);
        return nullptr;
    }

    static PyObject* SpatialAnchorManager_RequestStoreAsync(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialAnchorManager", L"RequestStoreAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Perception::Spatial::SpatialAnchorManager::RequestStoreAsync());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialAnchorManager[] = {
        { "request_store_async", reinterpret_cast<PyCFunction>(SpatialAnchorManager_RequestStoreAsync), METH_VARARGS | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialAnchorManager[] = {
        { }
    };

    static PyType_Slot _type_slots_SpatialAnchorManager[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialAnchorManager) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialAnchorManager) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialAnchorManager) },
        { },
    };

    static PyType_Spec type_spec_SpatialAnchorManager =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialAnchorManager",
        0,
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialAnchorManager
    };

    // ----- SpatialAnchorRawCoordinateSystemAdjustedEventArgs class --------------------
    static constexpr const char* const type_name_SpatialAnchorRawCoordinateSystemAdjustedEventArgs = "SpatialAnchorRawCoordinateSystemAdjustedEventArgs";

    static PyObject* _new_SpatialAnchorRawCoordinateSystemAdjustedEventArgs(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialAnchorRawCoordinateSystemAdjustedEventArgs);
        return nullptr;
    }

    static void _dealloc_SpatialAnchorRawCoordinateSystemAdjustedEventArgs(py::wrapper::Windows::Perception::Spatial::SpatialAnchorRawCoordinateSystemAdjustedEventArgs* 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* SpatialAnchorRawCoordinateSystemAdjustedEventArgs_get_OldRawCoordinateSystemToNewRawCoordinateSystemTransform(py::wrapper::Windows::Perception::Spatial::SpatialAnchorRawCoordinateSystemAdjustedEventArgs* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Perception.Spatial.SpatialAnchorRawCoordinateSystemAdjustedEventArgs", L"OldRawCoordinateSystemToNewRawCoordinateSystemTransform"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

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

    static PyObject* _from_SpatialAnchorRawCoordinateSystemAdjustedEventArgs(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::Perception::Spatial::SpatialAnchorRawCoordinateSystemAdjustedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialAnchorRawCoordinateSystemAdjustedEventArgs[] = {
        { "_assign_array_", _assign_array_SpatialAnchorRawCoordinateSystemAdjustedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SpatialAnchorRawCoordinateSystemAdjustedEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialAnchorRawCoordinateSystemAdjustedEventArgs[] = {
        { "old_raw_coordinate_system_to_new_raw_coordinate_system_transform", reinterpret_cast<getter>(SpatialAnchorRawCoordinateSystemAdjustedEventArgs_get_OldRawCoordinateSystemToNewRawCoordinateSystemTransform), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SpatialAnchorRawCoordinateSystemAdjustedEventArgs[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialAnchorRawCoordinateSystemAdjustedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialAnchorRawCoordinateSystemAdjustedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialAnchorRawCoordinateSystemAdjustedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialAnchorRawCoordinateSystemAdjustedEventArgs) },
        { },
    };

    static PyType_Spec type_spec_SpatialAnchorRawCoordinateSystemAdjustedEventArgs =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialAnchorRawCoordinateSystemAdjustedEventArgs",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialAnchorRawCoordinateSystemAdjustedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialAnchorRawCoordinateSystemAdjustedEventArgs
    };

    // ----- SpatialAnchorStore class --------------------
    static constexpr const char* const type_name_SpatialAnchorStore = "SpatialAnchorStore";

    static PyObject* _new_SpatialAnchorStore(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialAnchorStore);
        return nullptr;
    }

    static void _dealloc_SpatialAnchorStore(py::wrapper::Windows::Perception::Spatial::SpatialAnchorStore* 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* SpatialAnchorStore_Clear(py::wrapper::Windows::Perception::Spatial::SpatialAnchorStore* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialAnchorStore", 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* SpatialAnchorStore_GetAllSavedAnchors(py::wrapper::Windows::Perception::Spatial::SpatialAnchorStore* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialAnchorStore", L"GetAllSavedAnchors", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* SpatialAnchorStore_Remove(py::wrapper::Windows::Perception::Spatial::SpatialAnchorStore* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialAnchorStore", 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* SpatialAnchorStore_TrySave(py::wrapper::Windows::Perception::Spatial::SpatialAnchorStore* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialAnchorStore", L"TrySave", 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::Perception::Spatial::SpatialAnchor>(args, 1);

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

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

    static PyObject* _from_SpatialAnchorStore(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::Perception::Spatial::SpatialAnchorStore>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialAnchorStore[] = {
        { "clear", reinterpret_cast<PyCFunction>(SpatialAnchorStore_Clear), METH_VARARGS, nullptr },
        { "get_all_saved_anchors", reinterpret_cast<PyCFunction>(SpatialAnchorStore_GetAllSavedAnchors), METH_VARARGS, nullptr },
        { "remove", reinterpret_cast<PyCFunction>(SpatialAnchorStore_Remove), METH_VARARGS, nullptr },
        { "try_save", reinterpret_cast<PyCFunction>(SpatialAnchorStore_TrySave), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_SpatialAnchorStore, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SpatialAnchorStore), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialAnchorStore[] = {
        { }
    };

    static PyType_Slot _type_slots_SpatialAnchorStore[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialAnchorStore) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialAnchorStore) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialAnchorStore) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialAnchorStore) },
        { },
    };

    static PyType_Spec type_spec_SpatialAnchorStore =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialAnchorStore",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialAnchorStore),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialAnchorStore
    };

    // ----- SpatialAnchorTransferManager class --------------------
    static constexpr const char* const type_name_SpatialAnchorTransferManager = "SpatialAnchorTransferManager";

    static PyObject* _new_SpatialAnchorTransferManager(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialAnchorTransferManager);
        return nullptr;
    }

    static PyObject* SpatialAnchorTransferManager_RequestAccessAsync(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialAnchorTransferManager", L"RequestAccessAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Perception::Spatial::SpatialAnchorTransferManager::RequestAccessAsync());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* SpatialAnchorTransferManager_TryExportAnchorsAsync(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialAnchorTransferManager", L"TryExportAnchorsAsync", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Foundation::Collections::IIterable<winrt::Windows::Foundation::Collections::IKeyValuePair<winrt::hstring, winrt::Windows::Perception::Spatial::SpatialAnchor>>>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Storage::Streams::IOutputStream>(args, 1);

                return py::convert(winrt::Windows::Perception::Spatial::SpatialAnchorTransferManager::TryExportAnchorsAsync(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* SpatialAnchorTransferManager_TryImportAnchorsAsync(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialAnchorTransferManager", L"TryImportAnchorsAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Storage::Streams::IInputStream>(args, 0);

                return py::convert(winrt::Windows::Perception::Spatial::SpatialAnchorTransferManager::TryImportAnchorsAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialAnchorTransferManager[] = {
        { "request_access_async", reinterpret_cast<PyCFunction>(SpatialAnchorTransferManager_RequestAccessAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "try_export_anchors_async", reinterpret_cast<PyCFunction>(SpatialAnchorTransferManager_TryExportAnchorsAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "try_import_anchors_async", reinterpret_cast<PyCFunction>(SpatialAnchorTransferManager_TryImportAnchorsAsync), METH_VARARGS | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialAnchorTransferManager[] = {
        { }
    };

    static PyType_Slot _type_slots_SpatialAnchorTransferManager[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialAnchorTransferManager) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialAnchorTransferManager) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialAnchorTransferManager) },
        { },
    };

    static PyType_Spec type_spec_SpatialAnchorTransferManager =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialAnchorTransferManager",
        0,
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialAnchorTransferManager
    };

    // ----- SpatialBoundingVolume class --------------------
    static constexpr const char* const type_name_SpatialBoundingVolume = "SpatialBoundingVolume";

    static PyObject* _new_SpatialBoundingVolume(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialBoundingVolume);
        return nullptr;
    }

    static void _dealloc_SpatialBoundingVolume(py::wrapper::Windows::Perception::Spatial::SpatialBoundingVolume* 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* SpatialBoundingVolume_FromBox(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialBoundingVolume", L"FromBox", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialCoordinateSystem>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialBoundingBox>(args, 1);

                return py::convert(winrt::Windows::Perception::Spatial::SpatialBoundingVolume::FromBox(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* SpatialBoundingVolume_FromFrustum(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialBoundingVolume", L"FromFrustum", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialCoordinateSystem>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialBoundingFrustum>(args, 1);

                return py::convert(winrt::Windows::Perception::Spatial::SpatialBoundingVolume::FromFrustum(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* SpatialBoundingVolume_FromOrientedBox(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialBoundingVolume", L"FromOrientedBox", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialCoordinateSystem>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialBoundingOrientedBox>(args, 1);

                return py::convert(winrt::Windows::Perception::Spatial::SpatialBoundingVolume::FromOrientedBox(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* SpatialBoundingVolume_FromSphere(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialBoundingVolume", L"FromSphere", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialCoordinateSystem>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialBoundingSphere>(args, 1);

                return py::convert(winrt::Windows::Perception::Spatial::SpatialBoundingVolume::FromSphere(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

    static PyObject* _from_SpatialBoundingVolume(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::Perception::Spatial::SpatialBoundingVolume>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialBoundingVolume[] = {
        { "from_box", reinterpret_cast<PyCFunction>(SpatialBoundingVolume_FromBox), METH_VARARGS | METH_STATIC, nullptr },
        { "from_frustum", reinterpret_cast<PyCFunction>(SpatialBoundingVolume_FromFrustum), METH_VARARGS | METH_STATIC, nullptr },
        { "from_oriented_box", reinterpret_cast<PyCFunction>(SpatialBoundingVolume_FromOrientedBox), METH_VARARGS | METH_STATIC, nullptr },
        { "from_sphere", reinterpret_cast<PyCFunction>(SpatialBoundingVolume_FromSphere), METH_VARARGS | METH_STATIC, nullptr },
        { "_assign_array_", _assign_array_SpatialBoundingVolume, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SpatialBoundingVolume), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialBoundingVolume[] = {
        { }
    };

    static PyType_Slot _type_slots_SpatialBoundingVolume[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialBoundingVolume) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialBoundingVolume) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialBoundingVolume) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialBoundingVolume) },
        { },
    };

    static PyType_Spec type_spec_SpatialBoundingVolume =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialBoundingVolume",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialBoundingVolume),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialBoundingVolume
    };

    // ----- SpatialCoordinateSystem class --------------------
    static constexpr const char* const type_name_SpatialCoordinateSystem = "SpatialCoordinateSystem";

    static PyObject* _new_SpatialCoordinateSystem(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialCoordinateSystem);
        return nullptr;
    }

    static void _dealloc_SpatialCoordinateSystem(py::wrapper::Windows::Perception::Spatial::SpatialCoordinateSystem* 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* SpatialCoordinateSystem_TryGetTransformTo(py::wrapper::Windows::Perception::Spatial::SpatialCoordinateSystem* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialCoordinateSystem", L"TryGetTransformTo", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialCoordinateSystem>(args, 0);

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

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

    static PyObject* _from_SpatialCoordinateSystem(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::Perception::Spatial::SpatialCoordinateSystem>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialCoordinateSystem[] = {
        { "try_get_transform_to", reinterpret_cast<PyCFunction>(SpatialCoordinateSystem_TryGetTransformTo), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_SpatialCoordinateSystem, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SpatialCoordinateSystem), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialCoordinateSystem[] = {
        { }
    };

    static PyType_Slot _type_slots_SpatialCoordinateSystem[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialCoordinateSystem) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialCoordinateSystem) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialCoordinateSystem) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialCoordinateSystem) },
        { },
    };

    static PyType_Spec type_spec_SpatialCoordinateSystem =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialCoordinateSystem",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialCoordinateSystem),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialCoordinateSystem
    };

    // ----- SpatialEntity class --------------------
    static constexpr const char* const type_name_SpatialEntity = "SpatialEntity";

    static PyObject* _new_SpatialEntity(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 == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialAnchor>(args, 0);

                winrt::Windows::Perception::Spatial::SpatialEntity instance{ param0 };
                return py::wrap(instance, type);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 2)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialAnchor>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::Collections::ValueSet>(args, 1);

                winrt::Windows::Perception::Spatial::SpatialEntity instance{ param0, param1 };
                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_SpatialEntity(py::wrapper::Windows::Perception::Spatial::SpatialEntity* 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* SpatialEntity_get_Anchor(py::wrapper::Windows::Perception::Spatial::SpatialEntity* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Perception.Spatial.SpatialEntity", L"Anchor"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

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

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

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

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

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

    static PyObject* _from_SpatialEntity(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::Perception::Spatial::SpatialEntity>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialEntity[] = {
        { "_assign_array_", _assign_array_SpatialEntity, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SpatialEntity), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialEntity[] = {
        { "anchor", reinterpret_cast<getter>(SpatialEntity_get_Anchor), nullptr, nullptr, nullptr },
        { "id", reinterpret_cast<getter>(SpatialEntity_get_Id), nullptr, nullptr, nullptr },
        { "properties", reinterpret_cast<getter>(SpatialEntity_get_Properties), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SpatialEntity[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialEntity) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialEntity) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialEntity) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialEntity) },
        { },
    };

    static PyType_Spec type_spec_SpatialEntity =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialEntity",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialEntity),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialEntity
    };

    // ----- SpatialEntityAddedEventArgs class --------------------
    static constexpr const char* const type_name_SpatialEntityAddedEventArgs = "SpatialEntityAddedEventArgs";

    static PyObject* _new_SpatialEntityAddedEventArgs(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialEntityAddedEventArgs);
        return nullptr;
    }

    static void _dealloc_SpatialEntityAddedEventArgs(py::wrapper::Windows::Perception::Spatial::SpatialEntityAddedEventArgs* 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* SpatialEntityAddedEventArgs_get_Entity(py::wrapper::Windows::Perception::Spatial::SpatialEntityAddedEventArgs* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Perception.Spatial.SpatialEntityAddedEventArgs", L"Entity"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

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

    static PyObject* _from_SpatialEntityAddedEventArgs(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::Perception::Spatial::SpatialEntityAddedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialEntityAddedEventArgs[] = {
        { "_assign_array_", _assign_array_SpatialEntityAddedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SpatialEntityAddedEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialEntityAddedEventArgs[] = {
        { "entity", reinterpret_cast<getter>(SpatialEntityAddedEventArgs_get_Entity), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SpatialEntityAddedEventArgs[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialEntityAddedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialEntityAddedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialEntityAddedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialEntityAddedEventArgs) },
        { },
    };

    static PyType_Spec type_spec_SpatialEntityAddedEventArgs =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialEntityAddedEventArgs",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialEntityAddedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialEntityAddedEventArgs
    };

    // ----- SpatialEntityRemovedEventArgs class --------------------
    static constexpr const char* const type_name_SpatialEntityRemovedEventArgs = "SpatialEntityRemovedEventArgs";

    static PyObject* _new_SpatialEntityRemovedEventArgs(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialEntityRemovedEventArgs);
        return nullptr;
    }

    static void _dealloc_SpatialEntityRemovedEventArgs(py::wrapper::Windows::Perception::Spatial::SpatialEntityRemovedEventArgs* 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* SpatialEntityRemovedEventArgs_get_Entity(py::wrapper::Windows::Perception::Spatial::SpatialEntityRemovedEventArgs* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Perception.Spatial.SpatialEntityRemovedEventArgs", L"Entity"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

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

    static PyObject* _from_SpatialEntityRemovedEventArgs(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::Perception::Spatial::SpatialEntityRemovedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialEntityRemovedEventArgs[] = {
        { "_assign_array_", _assign_array_SpatialEntityRemovedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SpatialEntityRemovedEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialEntityRemovedEventArgs[] = {
        { "entity", reinterpret_cast<getter>(SpatialEntityRemovedEventArgs_get_Entity), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SpatialEntityRemovedEventArgs[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialEntityRemovedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialEntityRemovedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialEntityRemovedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialEntityRemovedEventArgs) },
        { },
    };

    static PyType_Spec type_spec_SpatialEntityRemovedEventArgs =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialEntityRemovedEventArgs",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialEntityRemovedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialEntityRemovedEventArgs
    };

    // ----- SpatialEntityStore class --------------------
    static constexpr const char* const type_name_SpatialEntityStore = "SpatialEntityStore";

    static PyObject* _new_SpatialEntityStore(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialEntityStore);
        return nullptr;
    }

    static void _dealloc_SpatialEntityStore(py::wrapper::Windows::Perception::Spatial::SpatialEntityStore* 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* SpatialEntityStore_CreateEntityWatcher(py::wrapper::Windows::Perception::Spatial::SpatialEntityStore* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialEntityStore", L"CreateEntityWatcher", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* SpatialEntityStore_RemoveAsync(py::wrapper::Windows::Perception::Spatial::SpatialEntityStore* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialEntityStore", L"RemoveAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialEntity>(args, 0);

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

    static PyObject* SpatialEntityStore_SaveAsync(py::wrapper::Windows::Perception::Spatial::SpatialEntityStore* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialEntityStore", L"SaveAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialEntity>(args, 0);

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

    static PyObject* SpatialEntityStore_TryGet(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialEntityStore", L"TryGet", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::System::RemoteSystems::RemoteSystemSession>(args, 0);

                return py::convert(winrt::Windows::Perception::Spatial::SpatialEntityStore::TryGet(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* SpatialEntityStore_get_IsSupported(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Perception.Spatial.SpatialEntityStore", L"IsSupported"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Perception::Spatial::SpatialEntityStore::IsSupported());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_SpatialEntityStore(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::Perception::Spatial::SpatialEntityStore>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialEntityStore[] = {
        { "create_entity_watcher", reinterpret_cast<PyCFunction>(SpatialEntityStore_CreateEntityWatcher), METH_VARARGS, nullptr },
        { "remove_async", reinterpret_cast<PyCFunction>(SpatialEntityStore_RemoveAsync), METH_VARARGS, nullptr },
        { "save_async", reinterpret_cast<PyCFunction>(SpatialEntityStore_SaveAsync), METH_VARARGS, nullptr },
        { "try_get", reinterpret_cast<PyCFunction>(SpatialEntityStore_TryGet), METH_VARARGS | METH_STATIC, nullptr },
        { "_assign_array_", _assign_array_SpatialEntityStore, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SpatialEntityStore), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialEntityStore[] = {
        { }
    };

    static PyType_Slot _type_slots_SpatialEntityStore[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialEntityStore) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialEntityStore) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialEntityStore) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialEntityStore) },
        { },
    };

    static PyType_Spec type_spec_SpatialEntityStore =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialEntityStore",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialEntityStore),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialEntityStore
    };

    static PyGetSetDef getset_SpatialEntityStore_Meta[] = {
        { "is_supported", reinterpret_cast<getter>(SpatialEntityStore_get_IsSupported), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot type_slots_SpatialEntityStore_Meta[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_SpatialEntityStore_Meta) },
        { }
    };

    static PyType_Spec type_spec_SpatialEntityStore_Meta =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialEntityStore_Meta",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_SpatialEntityStore_Meta
    };

    // ----- SpatialEntityUpdatedEventArgs class --------------------
    static constexpr const char* const type_name_SpatialEntityUpdatedEventArgs = "SpatialEntityUpdatedEventArgs";

    static PyObject* _new_SpatialEntityUpdatedEventArgs(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialEntityUpdatedEventArgs);
        return nullptr;
    }

    static void _dealloc_SpatialEntityUpdatedEventArgs(py::wrapper::Windows::Perception::Spatial::SpatialEntityUpdatedEventArgs* 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* SpatialEntityUpdatedEventArgs_get_Entity(py::wrapper::Windows::Perception::Spatial::SpatialEntityUpdatedEventArgs* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Perception.Spatial.SpatialEntityUpdatedEventArgs", L"Entity"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

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

    static PyObject* _from_SpatialEntityUpdatedEventArgs(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::Perception::Spatial::SpatialEntityUpdatedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialEntityUpdatedEventArgs[] = {
        { "_assign_array_", _assign_array_SpatialEntityUpdatedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SpatialEntityUpdatedEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialEntityUpdatedEventArgs[] = {
        { "entity", reinterpret_cast<getter>(SpatialEntityUpdatedEventArgs_get_Entity), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SpatialEntityUpdatedEventArgs[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialEntityUpdatedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialEntityUpdatedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialEntityUpdatedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialEntityUpdatedEventArgs) },
        { },
    };

    static PyType_Spec type_spec_SpatialEntityUpdatedEventArgs =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialEntityUpdatedEventArgs",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialEntityUpdatedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialEntityUpdatedEventArgs
    };

    // ----- SpatialEntityWatcher class --------------------
    static constexpr const char* const type_name_SpatialEntityWatcher = "SpatialEntityWatcher";

    static PyObject* _new_SpatialEntityWatcher(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialEntityWatcher);
        return nullptr;
    }

    static void _dealloc_SpatialEntityWatcher(py::wrapper::Windows::Perception::Spatial::SpatialEntityWatcher* 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* SpatialEntityWatcher_Start(py::wrapper::Windows::Perception::Spatial::SpatialEntityWatcher* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialEntityWatcher", L"Start", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* SpatialEntityWatcher_Stop(py::wrapper::Windows::Perception::Spatial::SpatialEntityWatcher* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialEntityWatcher", L"Stop", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

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

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

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

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Perception::Spatial::SpatialEntityWatcher, winrt::Windows::Perception::Spatial::SpatialEntityAddedEventArgs>>(arg);

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

    static PyObject* SpatialEntityWatcher_remove_Added(py::wrapper::Windows::Perception::Spatial::SpatialEntityWatcher* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Perception.Spatial.SpatialEntityWatcher", L"Added"))
        {
            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.Added(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Perception::Spatial::SpatialEntityWatcher, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* SpatialEntityWatcher_remove_EnumerationCompleted(py::wrapper::Windows::Perception::Spatial::SpatialEntityWatcher* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Perception.Spatial.SpatialEntityWatcher", L"EnumerationCompleted"))
        {
            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.EnumerationCompleted(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Perception::Spatial::SpatialEntityWatcher, winrt::Windows::Perception::Spatial::SpatialEntityRemovedEventArgs>>(arg);

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

    static PyObject* SpatialEntityWatcher_remove_Removed(py::wrapper::Windows::Perception::Spatial::SpatialEntityWatcher* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Perception.Spatial.SpatialEntityWatcher", L"Removed"))
        {
            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.Removed(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Perception::Spatial::SpatialEntityWatcher, winrt::Windows::Perception::Spatial::SpatialEntityUpdatedEventArgs>>(arg);

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

    static PyObject* SpatialEntityWatcher_remove_Updated(py::wrapper::Windows::Perception::Spatial::SpatialEntityWatcher* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Perception.Spatial.SpatialEntityWatcher", L"Updated"))
        {
            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.Updated(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_SpatialEntityWatcher(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::Perception::Spatial::SpatialEntityWatcher>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialEntityWatcher[] = {
        { "start", reinterpret_cast<PyCFunction>(SpatialEntityWatcher_Start), METH_VARARGS, nullptr },
        { "stop", reinterpret_cast<PyCFunction>(SpatialEntityWatcher_Stop), METH_VARARGS, nullptr },
        { "add_added", reinterpret_cast<PyCFunction>(SpatialEntityWatcher_add_Added), METH_O, nullptr },
        { "remove_added", reinterpret_cast<PyCFunction>(SpatialEntityWatcher_remove_Added), METH_O, nullptr },
        { "add_enumeration_completed", reinterpret_cast<PyCFunction>(SpatialEntityWatcher_add_EnumerationCompleted), METH_O, nullptr },
        { "remove_enumeration_completed", reinterpret_cast<PyCFunction>(SpatialEntityWatcher_remove_EnumerationCompleted), METH_O, nullptr },
        { "add_removed", reinterpret_cast<PyCFunction>(SpatialEntityWatcher_add_Removed), METH_O, nullptr },
        { "remove_removed", reinterpret_cast<PyCFunction>(SpatialEntityWatcher_remove_Removed), METH_O, nullptr },
        { "add_updated", reinterpret_cast<PyCFunction>(SpatialEntityWatcher_add_Updated), METH_O, nullptr },
        { "remove_updated", reinterpret_cast<PyCFunction>(SpatialEntityWatcher_remove_Updated), METH_O, nullptr },
        { "_assign_array_", _assign_array_SpatialEntityWatcher, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SpatialEntityWatcher), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialEntityWatcher[] = {
        { "status", reinterpret_cast<getter>(SpatialEntityWatcher_get_Status), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SpatialEntityWatcher[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialEntityWatcher) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialEntityWatcher) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialEntityWatcher) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialEntityWatcher) },
        { },
    };

    static PyType_Spec type_spec_SpatialEntityWatcher =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialEntityWatcher",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialEntityWatcher),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialEntityWatcher
    };

    // ----- SpatialLocation class --------------------
    static constexpr const char* const type_name_SpatialLocation = "SpatialLocation";

    static PyObject* _new_SpatialLocation(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialLocation);
        return nullptr;
    }

    static void _dealloc_SpatialLocation(py::wrapper::Windows::Perception::Spatial::SpatialLocation* 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* SpatialLocation_get_AbsoluteAngularAcceleration(py::wrapper::Windows::Perception::Spatial::SpatialLocation* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Perception.Spatial.SpatialLocation", L"AbsoluteAngularAcceleration"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    static PyObject* _from_SpatialLocation(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::Perception::Spatial::SpatialLocation>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialLocation[] = {
        { "_assign_array_", _assign_array_SpatialLocation, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SpatialLocation), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialLocation[] = {
        { "absolute_angular_acceleration", reinterpret_cast<getter>(SpatialLocation_get_AbsoluteAngularAcceleration), nullptr, nullptr, nullptr },
        { "absolute_angular_velocity", reinterpret_cast<getter>(SpatialLocation_get_AbsoluteAngularVelocity), nullptr, nullptr, nullptr },
        { "absolute_linear_acceleration", reinterpret_cast<getter>(SpatialLocation_get_AbsoluteLinearAcceleration), nullptr, nullptr, nullptr },
        { "absolute_linear_velocity", reinterpret_cast<getter>(SpatialLocation_get_AbsoluteLinearVelocity), nullptr, nullptr, nullptr },
        { "orientation", reinterpret_cast<getter>(SpatialLocation_get_Orientation), nullptr, nullptr, nullptr },
        { "position", reinterpret_cast<getter>(SpatialLocation_get_Position), nullptr, nullptr, nullptr },
        { "absolute_angular_acceleration_axis_angle", reinterpret_cast<getter>(SpatialLocation_get_AbsoluteAngularAccelerationAxisAngle), nullptr, nullptr, nullptr },
        { "absolute_angular_velocity_axis_angle", reinterpret_cast<getter>(SpatialLocation_get_AbsoluteAngularVelocityAxisAngle), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SpatialLocation[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialLocation) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialLocation) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialLocation) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialLocation) },
        { },
    };

    static PyType_Spec type_spec_SpatialLocation =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialLocation",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialLocation),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialLocation
    };

    // ----- SpatialLocator class --------------------
    static constexpr const char* const type_name_SpatialLocator = "SpatialLocator";

    static PyObject* _new_SpatialLocator(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialLocator);
        return nullptr;
    }

    static void _dealloc_SpatialLocator(py::wrapper::Windows::Perception::Spatial::SpatialLocator* 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* SpatialLocator_CreateAttachedFrameOfReferenceAtCurrentHeading(py::wrapper::Windows::Perception::Spatial::SpatialLocator* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialLocator", L"CreateAttachedFrameOfReferenceAtCurrentHeading", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(self->obj.CreateAttachedFrameOfReferenceAtCurrentHeading());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialLocator", L"CreateAttachedFrameOfReferenceAtCurrentHeading", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Foundation::Numerics::float3>(args, 0);

                return py::convert(self->obj.CreateAttachedFrameOfReferenceAtCurrentHeading(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialLocator", L"CreateAttachedFrameOfReferenceAtCurrentHeading", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Foundation::Numerics::float3>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::Numerics::quaternion>(args, 1);

                return py::convert(self->obj.CreateAttachedFrameOfReferenceAtCurrentHeading(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 3)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialLocator", L"CreateAttachedFrameOfReferenceAtCurrentHeading", 3))
            {
                py::set_arg_count_version_error(3);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Foundation::Numerics::float3>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::Numerics::quaternion>(args, 1);
                auto param2 = py::convert_to<double>(args, 2);

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

    static PyObject* SpatialLocator_CreateStationaryFrameOfReferenceAtCurrentLocation(py::wrapper::Windows::Perception::Spatial::SpatialLocator* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialLocator", L"CreateStationaryFrameOfReferenceAtCurrentLocation", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(self->obj.CreateStationaryFrameOfReferenceAtCurrentLocation());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialLocator", L"CreateStationaryFrameOfReferenceAtCurrentLocation", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Foundation::Numerics::float3>(args, 0);

                return py::convert(self->obj.CreateStationaryFrameOfReferenceAtCurrentLocation(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialLocator", L"CreateStationaryFrameOfReferenceAtCurrentLocation", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Foundation::Numerics::float3>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::Numerics::quaternion>(args, 1);

                return py::convert(self->obj.CreateStationaryFrameOfReferenceAtCurrentLocation(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 3)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialLocator", L"CreateStationaryFrameOfReferenceAtCurrentLocation", 3))
            {
                py::set_arg_count_version_error(3);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Foundation::Numerics::float3>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::Numerics::quaternion>(args, 1);
                auto param2 = py::convert_to<double>(args, 2);

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

    static PyObject* SpatialLocator_GetDefault(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialLocator", L"GetDefault", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Perception::Spatial::SpatialLocator::GetDefault());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* SpatialLocator_TryLocateAtTimestamp(py::wrapper::Windows::Perception::Spatial::SpatialLocator* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialLocator", L"TryLocateAtTimestamp", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Perception::PerceptionTimestamp>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialCoordinateSystem>(args, 1);

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

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

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

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

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Perception::Spatial::SpatialLocator, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* SpatialLocator_remove_LocatabilityChanged(py::wrapper::Windows::Perception::Spatial::SpatialLocator* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Perception.Spatial.SpatialLocator", L"LocatabilityChanged"))
        {
            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.LocatabilityChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Perception::Spatial::SpatialLocator, winrt::Windows::Perception::Spatial::SpatialLocatorPositionalTrackingDeactivatingEventArgs>>(arg);

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

    static PyObject* SpatialLocator_remove_PositionalTrackingDeactivating(py::wrapper::Windows::Perception::Spatial::SpatialLocator* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Perception.Spatial.SpatialLocator", L"PositionalTrackingDeactivating"))
        {
            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.PositionalTrackingDeactivating(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_SpatialLocator(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::Perception::Spatial::SpatialLocator>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialLocator[] = {
        { "create_attached_frame_of_reference_at_current_heading", reinterpret_cast<PyCFunction>(SpatialLocator_CreateAttachedFrameOfReferenceAtCurrentHeading), METH_VARARGS, nullptr },
        { "create_stationary_frame_of_reference_at_current_location", reinterpret_cast<PyCFunction>(SpatialLocator_CreateStationaryFrameOfReferenceAtCurrentLocation), METH_VARARGS, nullptr },
        { "get_default", reinterpret_cast<PyCFunction>(SpatialLocator_GetDefault), METH_VARARGS | METH_STATIC, nullptr },
        { "try_locate_at_timestamp", reinterpret_cast<PyCFunction>(SpatialLocator_TryLocateAtTimestamp), METH_VARARGS, nullptr },
        { "add_locatability_changed", reinterpret_cast<PyCFunction>(SpatialLocator_add_LocatabilityChanged), METH_O, nullptr },
        { "remove_locatability_changed", reinterpret_cast<PyCFunction>(SpatialLocator_remove_LocatabilityChanged), METH_O, nullptr },
        { "add_positional_tracking_deactivating", reinterpret_cast<PyCFunction>(SpatialLocator_add_PositionalTrackingDeactivating), METH_O, nullptr },
        { "remove_positional_tracking_deactivating", reinterpret_cast<PyCFunction>(SpatialLocator_remove_PositionalTrackingDeactivating), METH_O, nullptr },
        { "_assign_array_", _assign_array_SpatialLocator, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SpatialLocator), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialLocator[] = {
        { "locatability", reinterpret_cast<getter>(SpatialLocator_get_Locatability), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SpatialLocator[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialLocator) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialLocator) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialLocator) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialLocator) },
        { },
    };

    static PyType_Spec type_spec_SpatialLocator =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialLocator",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialLocator),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialLocator
    };

    // ----- SpatialLocatorAttachedFrameOfReference class --------------------
    static constexpr const char* const type_name_SpatialLocatorAttachedFrameOfReference = "SpatialLocatorAttachedFrameOfReference";

    static PyObject* _new_SpatialLocatorAttachedFrameOfReference(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialLocatorAttachedFrameOfReference);
        return nullptr;
    }

    static void _dealloc_SpatialLocatorAttachedFrameOfReference(py::wrapper::Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference* 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* SpatialLocatorAttachedFrameOfReference_AdjustHeading(py::wrapper::Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialLocatorAttachedFrameOfReference", L"AdjustHeading", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<double>(args, 0);

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

    static PyObject* SpatialLocatorAttachedFrameOfReference_GetStationaryCoordinateSystemAtTimestamp(py::wrapper::Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialLocatorAttachedFrameOfReference", L"GetStationaryCoordinateSystemAtTimestamp", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Perception::PerceptionTimestamp>(args, 0);

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

    static PyObject* SpatialLocatorAttachedFrameOfReference_TryGetRelativeHeadingAtTimestamp(py::wrapper::Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialLocatorAttachedFrameOfReference", L"TryGetRelativeHeadingAtTimestamp", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Perception::PerceptionTimestamp>(args, 0);

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

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

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

    static int SpatialLocatorAttachedFrameOfReference_put_RelativePosition(py::wrapper::Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Perception.Spatial.SpatialLocatorAttachedFrameOfReference", L"RelativePosition"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::Numerics::float3>(arg);

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

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

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

    static int SpatialLocatorAttachedFrameOfReference_put_RelativeOrientation(py::wrapper::Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Perception.Spatial.SpatialLocatorAttachedFrameOfReference", L"RelativeOrientation"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::Numerics::quaternion>(arg);

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

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

    static PyObject* _from_SpatialLocatorAttachedFrameOfReference(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::Perception::Spatial::SpatialLocatorAttachedFrameOfReference>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialLocatorAttachedFrameOfReference[] = {
        { "adjust_heading", reinterpret_cast<PyCFunction>(SpatialLocatorAttachedFrameOfReference_AdjustHeading), METH_VARARGS, nullptr },
        { "get_stationary_coordinate_system_at_timestamp", reinterpret_cast<PyCFunction>(SpatialLocatorAttachedFrameOfReference_GetStationaryCoordinateSystemAtTimestamp), METH_VARARGS, nullptr },
        { "try_get_relative_heading_at_timestamp", reinterpret_cast<PyCFunction>(SpatialLocatorAttachedFrameOfReference_TryGetRelativeHeadingAtTimestamp), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_SpatialLocatorAttachedFrameOfReference, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SpatialLocatorAttachedFrameOfReference), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialLocatorAttachedFrameOfReference[] = {
        { "relative_position", reinterpret_cast<getter>(SpatialLocatorAttachedFrameOfReference_get_RelativePosition), reinterpret_cast<setter>(SpatialLocatorAttachedFrameOfReference_put_RelativePosition), nullptr, nullptr },
        { "relative_orientation", reinterpret_cast<getter>(SpatialLocatorAttachedFrameOfReference_get_RelativeOrientation), reinterpret_cast<setter>(SpatialLocatorAttachedFrameOfReference_put_RelativeOrientation), nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SpatialLocatorAttachedFrameOfReference[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialLocatorAttachedFrameOfReference) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialLocatorAttachedFrameOfReference) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialLocatorAttachedFrameOfReference) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialLocatorAttachedFrameOfReference) },
        { },
    };

    static PyType_Spec type_spec_SpatialLocatorAttachedFrameOfReference =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialLocatorAttachedFrameOfReference",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialLocatorAttachedFrameOfReference
    };

    // ----- SpatialLocatorPositionalTrackingDeactivatingEventArgs class --------------------
    static constexpr const char* const type_name_SpatialLocatorPositionalTrackingDeactivatingEventArgs = "SpatialLocatorPositionalTrackingDeactivatingEventArgs";

    static PyObject* _new_SpatialLocatorPositionalTrackingDeactivatingEventArgs(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialLocatorPositionalTrackingDeactivatingEventArgs);
        return nullptr;
    }

    static void _dealloc_SpatialLocatorPositionalTrackingDeactivatingEventArgs(py::wrapper::Windows::Perception::Spatial::SpatialLocatorPositionalTrackingDeactivatingEventArgs* 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* SpatialLocatorPositionalTrackingDeactivatingEventArgs_get_Canceled(py::wrapper::Windows::Perception::Spatial::SpatialLocatorPositionalTrackingDeactivatingEventArgs* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Perception.Spatial.SpatialLocatorPositionalTrackingDeactivatingEventArgs", L"Canceled"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static int SpatialLocatorPositionalTrackingDeactivatingEventArgs_put_Canceled(py::wrapper::Windows::Perception::Spatial::SpatialLocatorPositionalTrackingDeactivatingEventArgs* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Perception.Spatial.SpatialLocatorPositionalTrackingDeactivatingEventArgs", L"Canceled"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

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

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

    static PyObject* _from_SpatialLocatorPositionalTrackingDeactivatingEventArgs(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::Perception::Spatial::SpatialLocatorPositionalTrackingDeactivatingEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialLocatorPositionalTrackingDeactivatingEventArgs[] = {
        { "_assign_array_", _assign_array_SpatialLocatorPositionalTrackingDeactivatingEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SpatialLocatorPositionalTrackingDeactivatingEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialLocatorPositionalTrackingDeactivatingEventArgs[] = {
        { "canceled", reinterpret_cast<getter>(SpatialLocatorPositionalTrackingDeactivatingEventArgs_get_Canceled), reinterpret_cast<setter>(SpatialLocatorPositionalTrackingDeactivatingEventArgs_put_Canceled), nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SpatialLocatorPositionalTrackingDeactivatingEventArgs[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialLocatorPositionalTrackingDeactivatingEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialLocatorPositionalTrackingDeactivatingEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialLocatorPositionalTrackingDeactivatingEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialLocatorPositionalTrackingDeactivatingEventArgs) },
        { },
    };

    static PyType_Spec type_spec_SpatialLocatorPositionalTrackingDeactivatingEventArgs =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialLocatorPositionalTrackingDeactivatingEventArgs",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialLocatorPositionalTrackingDeactivatingEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialLocatorPositionalTrackingDeactivatingEventArgs
    };

    // ----- SpatialStageFrameOfReference class --------------------
    static constexpr const char* const type_name_SpatialStageFrameOfReference = "SpatialStageFrameOfReference";

    static PyObject* _new_SpatialStageFrameOfReference(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialStageFrameOfReference);
        return nullptr;
    }

    static void _dealloc_SpatialStageFrameOfReference(py::wrapper::Windows::Perception::Spatial::SpatialStageFrameOfReference* 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* SpatialStageFrameOfReference_GetCoordinateSystemAtCurrentLocation(py::wrapper::Windows::Perception::Spatial::SpatialStageFrameOfReference* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialStageFrameOfReference", L"GetCoordinateSystemAtCurrentLocation", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialLocator>(args, 0);

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

    static PyObject* SpatialStageFrameOfReference_RequestNewStageAsync(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialStageFrameOfReference", L"RequestNewStageAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Perception::Spatial::SpatialStageFrameOfReference::RequestNewStageAsync());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* SpatialStageFrameOfReference_TryGetMovementBounds(py::wrapper::Windows::Perception::Spatial::SpatialStageFrameOfReference* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Perception.Spatial.SpatialStageFrameOfReference", L"TryGetMovementBounds", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Perception::Spatial::SpatialCoordinateSystem>(args, 0);

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

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

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

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

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

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

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

    static PyObject* SpatialStageFrameOfReference_get_Current(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Perception.Spatial.SpatialStageFrameOfReference", L"Current"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Perception::Spatial::SpatialStageFrameOfReference::Current());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* SpatialStageFrameOfReference_add_CurrentChanged(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Perception.Spatial.SpatialStageFrameOfReference", L"CurrentChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            return py::convert(winrt::Windows::Perception::Spatial::SpatialStageFrameOfReference::CurrentChanged(param0));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* SpatialStageFrameOfReference_remove_CurrentChanged(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Perception.Spatial.SpatialStageFrameOfReference", L"CurrentChanged"))
        {
            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);

            winrt::Windows::Perception::Spatial::SpatialStageFrameOfReference::CurrentChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_SpatialStageFrameOfReference(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::Perception::Spatial::SpatialStageFrameOfReference>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialStageFrameOfReference[] = {
        { "get_coordinate_system_at_current_location", reinterpret_cast<PyCFunction>(SpatialStageFrameOfReference_GetCoordinateSystemAtCurrentLocation), METH_VARARGS, nullptr },
        { "request_new_stage_async", reinterpret_cast<PyCFunction>(SpatialStageFrameOfReference_RequestNewStageAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "try_get_movement_bounds", reinterpret_cast<PyCFunction>(SpatialStageFrameOfReference_TryGetMovementBounds), METH_VARARGS, nullptr },
        { "add_current_changed", reinterpret_cast<PyCFunction>(SpatialStageFrameOfReference_add_CurrentChanged), METH_O | METH_STATIC, nullptr },
        { "remove_current_changed", reinterpret_cast<PyCFunction>(SpatialStageFrameOfReference_remove_CurrentChanged), METH_O | METH_STATIC, nullptr },
        { "_assign_array_", _assign_array_SpatialStageFrameOfReference, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SpatialStageFrameOfReference), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialStageFrameOfReference[] = {
        { "coordinate_system", reinterpret_cast<getter>(SpatialStageFrameOfReference_get_CoordinateSystem), nullptr, nullptr, nullptr },
        { "look_direction_range", reinterpret_cast<getter>(SpatialStageFrameOfReference_get_LookDirectionRange), nullptr, nullptr, nullptr },
        { "movement_range", reinterpret_cast<getter>(SpatialStageFrameOfReference_get_MovementRange), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SpatialStageFrameOfReference[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialStageFrameOfReference) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialStageFrameOfReference) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialStageFrameOfReference) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialStageFrameOfReference) },
        { },
    };

    static PyType_Spec type_spec_SpatialStageFrameOfReference =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialStageFrameOfReference",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialStageFrameOfReference),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialStageFrameOfReference
    };

    static PyGetSetDef getset_SpatialStageFrameOfReference_Meta[] = {
        { "current", reinterpret_cast<getter>(SpatialStageFrameOfReference_get_Current), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot type_slots_SpatialStageFrameOfReference_Meta[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_SpatialStageFrameOfReference_Meta) },
        { }
    };

    static PyType_Spec type_spec_SpatialStageFrameOfReference_Meta =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialStageFrameOfReference_Meta",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_SpatialStageFrameOfReference_Meta
    };

    // ----- SpatialStationaryFrameOfReference class --------------------
    static constexpr const char* const type_name_SpatialStationaryFrameOfReference = "SpatialStationaryFrameOfReference";

    static PyObject* _new_SpatialStationaryFrameOfReference(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(type_name_SpatialStationaryFrameOfReference);
        return nullptr;
    }

    static void _dealloc_SpatialStationaryFrameOfReference(py::wrapper::Windows::Perception::Spatial::SpatialStationaryFrameOfReference* 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* SpatialStationaryFrameOfReference_get_CoordinateSystem(py::wrapper::Windows::Perception::Spatial::SpatialStationaryFrameOfReference* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Perception.Spatial.SpatialStationaryFrameOfReference", L"CoordinateSystem"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

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

    static PyObject* _from_SpatialStationaryFrameOfReference(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::Perception::Spatial::SpatialStationaryFrameOfReference>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SpatialStationaryFrameOfReference[] = {
        { "_assign_array_", _assign_array_SpatialStationaryFrameOfReference, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SpatialStationaryFrameOfReference), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SpatialStationaryFrameOfReference[] = {
        { "coordinate_system", reinterpret_cast<getter>(SpatialStationaryFrameOfReference_get_CoordinateSystem), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SpatialStationaryFrameOfReference[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialStationaryFrameOfReference) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialStationaryFrameOfReference) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SpatialStationaryFrameOfReference) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialStationaryFrameOfReference) },
        { },
    };

    static PyType_Spec type_spec_SpatialStationaryFrameOfReference =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialStationaryFrameOfReference",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialStationaryFrameOfReference),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialStationaryFrameOfReference
    };

    // ----- SpatialBoundingBox struct --------------------
    static constexpr const char* const type_name_SpatialBoundingBox = "SpatialBoundingBox";

    PyObject* _new_SpatialBoundingBox(PyTypeObject* type, PyObject* args, PyObject* kwds)
    {
        auto tuple_size = PyTuple_Size(args);

        if ((tuple_size == 0) && (kwds == nullptr))
        {
            try
            {
                winrt::Windows::Perception::Spatial::SpatialBoundingBox return_value{};
                return py::convert(return_value);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }

        PyObject* _Center{};
        PyObject* _Extents{};

        static const char* kwlist[] = {"center", "extents", nullptr};
        if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO", const_cast<char**>(kwlist), &_Center, &_Extents))
        {
            return nullptr;
        }

        try
        {
            winrt::Windows::Perception::Spatial::SpatialBoundingBox return_value{ py::converter<winrt::Windows::Foundation::Numerics::float3>::convert_to(_Center), py::converter<winrt::Windows::Foundation::Numerics::float3>::convert_to(_Extents) };
            return py::convert(return_value);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static void _dealloc_SpatialBoundingBox(py::wrapper::Windows::Perception::Spatial::SpatialBoundingBox* self) noexcept
    {
    }

    static PyObject* SpatialBoundingBox_get_Center(py::wrapper::Windows::Perception::Spatial::SpatialBoundingBox* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Center);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int SpatialBoundingBox_set_Center(py::wrapper::Windows::Perception::Spatial::SpatialBoundingBox* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.Center = py::converter<winrt::Windows::Foundation::Numerics::float3>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* SpatialBoundingBox_get_Extents(py::wrapper::Windows::Perception::Spatial::SpatialBoundingBox* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Extents);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int SpatialBoundingBox_set_Extents(py::wrapper::Windows::Perception::Spatial::SpatialBoundingBox* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.Extents = py::converter<winrt::Windows::Foundation::Numerics::float3>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyGetSetDef _getset_SpatialBoundingBox[] = {
        { "center", reinterpret_cast<getter>(SpatialBoundingBox_get_Center), reinterpret_cast<setter>(SpatialBoundingBox_set_Center), nullptr, nullptr },
        { "extents", reinterpret_cast<getter>(SpatialBoundingBox_get_Extents), reinterpret_cast<setter>(SpatialBoundingBox_set_Extents), nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SpatialBoundingBox[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialBoundingBox) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialBoundingBox) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialBoundingBox) },
        { },
    };

    static PyType_Spec type_spec_SpatialBoundingBox =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialBoundingBox",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialBoundingBox),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialBoundingBox
    };

    // ----- SpatialBoundingFrustum struct --------------------
    static constexpr const char* const type_name_SpatialBoundingFrustum = "SpatialBoundingFrustum";

    PyObject* _new_SpatialBoundingFrustum(PyTypeObject* type, PyObject* args, PyObject* kwds)
    {
        auto tuple_size = PyTuple_Size(args);

        if ((tuple_size == 0) && (kwds == nullptr))
        {
            try
            {
                winrt::Windows::Perception::Spatial::SpatialBoundingFrustum return_value{};
                return py::convert(return_value);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }

        PyObject* _Near{};
        PyObject* _Far{};
        PyObject* _Right{};
        PyObject* _Left{};
        PyObject* _Top{};
        PyObject* _Bottom{};

        static const char* kwlist[] = {"near", "far", "right", "left", "top", "bottom", nullptr};
        if (!PyArg_ParseTupleAndKeywords(args, kwds, "OOOOOO", const_cast<char**>(kwlist), &_Near, &_Far, &_Right, &_Left, &_Top, &_Bottom))
        {
            return nullptr;
        }

        try
        {
            winrt::Windows::Perception::Spatial::SpatialBoundingFrustum return_value{ py::converter<winrt::Windows::Foundation::Numerics::plane>::convert_to(_Near), py::converter<winrt::Windows::Foundation::Numerics::plane>::convert_to(_Far), py::converter<winrt::Windows::Foundation::Numerics::plane>::convert_to(_Right), py::converter<winrt::Windows::Foundation::Numerics::plane>::convert_to(_Left), py::converter<winrt::Windows::Foundation::Numerics::plane>::convert_to(_Top), py::converter<winrt::Windows::Foundation::Numerics::plane>::convert_to(_Bottom) };
            return py::convert(return_value);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static void _dealloc_SpatialBoundingFrustum(py::wrapper::Windows::Perception::Spatial::SpatialBoundingFrustum* self) noexcept
    {
    }

    static PyObject* SpatialBoundingFrustum_get_Near(py::wrapper::Windows::Perception::Spatial::SpatialBoundingFrustum* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Near);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int SpatialBoundingFrustum_set_Near(py::wrapper::Windows::Perception::Spatial::SpatialBoundingFrustum* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.Near = py::converter<winrt::Windows::Foundation::Numerics::plane>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* SpatialBoundingFrustum_get_Far(py::wrapper::Windows::Perception::Spatial::SpatialBoundingFrustum* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Far);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int SpatialBoundingFrustum_set_Far(py::wrapper::Windows::Perception::Spatial::SpatialBoundingFrustum* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.Far = py::converter<winrt::Windows::Foundation::Numerics::plane>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* SpatialBoundingFrustum_get_Right(py::wrapper::Windows::Perception::Spatial::SpatialBoundingFrustum* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Right);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int SpatialBoundingFrustum_set_Right(py::wrapper::Windows::Perception::Spatial::SpatialBoundingFrustum* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.Right = py::converter<winrt::Windows::Foundation::Numerics::plane>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* SpatialBoundingFrustum_get_Left(py::wrapper::Windows::Perception::Spatial::SpatialBoundingFrustum* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Left);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int SpatialBoundingFrustum_set_Left(py::wrapper::Windows::Perception::Spatial::SpatialBoundingFrustum* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.Left = py::converter<winrt::Windows::Foundation::Numerics::plane>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* SpatialBoundingFrustum_get_Top(py::wrapper::Windows::Perception::Spatial::SpatialBoundingFrustum* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Top);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int SpatialBoundingFrustum_set_Top(py::wrapper::Windows::Perception::Spatial::SpatialBoundingFrustum* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.Top = py::converter<winrt::Windows::Foundation::Numerics::plane>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* SpatialBoundingFrustum_get_Bottom(py::wrapper::Windows::Perception::Spatial::SpatialBoundingFrustum* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Bottom);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int SpatialBoundingFrustum_set_Bottom(py::wrapper::Windows::Perception::Spatial::SpatialBoundingFrustum* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.Bottom = py::converter<winrt::Windows::Foundation::Numerics::plane>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyGetSetDef _getset_SpatialBoundingFrustum[] = {
        { "near", reinterpret_cast<getter>(SpatialBoundingFrustum_get_Near), reinterpret_cast<setter>(SpatialBoundingFrustum_set_Near), nullptr, nullptr },
        { "far", reinterpret_cast<getter>(SpatialBoundingFrustum_get_Far), reinterpret_cast<setter>(SpatialBoundingFrustum_set_Far), nullptr, nullptr },
        { "right", reinterpret_cast<getter>(SpatialBoundingFrustum_get_Right), reinterpret_cast<setter>(SpatialBoundingFrustum_set_Right), nullptr, nullptr },
        { "left", reinterpret_cast<getter>(SpatialBoundingFrustum_get_Left), reinterpret_cast<setter>(SpatialBoundingFrustum_set_Left), nullptr, nullptr },
        { "top", reinterpret_cast<getter>(SpatialBoundingFrustum_get_Top), reinterpret_cast<setter>(SpatialBoundingFrustum_set_Top), nullptr, nullptr },
        { "bottom", reinterpret_cast<getter>(SpatialBoundingFrustum_get_Bottom), reinterpret_cast<setter>(SpatialBoundingFrustum_set_Bottom), nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SpatialBoundingFrustum[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialBoundingFrustum) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialBoundingFrustum) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialBoundingFrustum) },
        { },
    };

    static PyType_Spec type_spec_SpatialBoundingFrustum =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialBoundingFrustum",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialBoundingFrustum),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialBoundingFrustum
    };

    // ----- SpatialBoundingOrientedBox struct --------------------
    static constexpr const char* const type_name_SpatialBoundingOrientedBox = "SpatialBoundingOrientedBox";

    PyObject* _new_SpatialBoundingOrientedBox(PyTypeObject* type, PyObject* args, PyObject* kwds)
    {
        auto tuple_size = PyTuple_Size(args);

        if ((tuple_size == 0) && (kwds == nullptr))
        {
            try
            {
                winrt::Windows::Perception::Spatial::SpatialBoundingOrientedBox return_value{};
                return py::convert(return_value);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }

        PyObject* _Center{};
        PyObject* _Extents{};
        PyObject* _Orientation{};

        static const char* kwlist[] = {"center", "extents", "orientation", nullptr};
        if (!PyArg_ParseTupleAndKeywords(args, kwds, "OOO", const_cast<char**>(kwlist), &_Center, &_Extents, &_Orientation))
        {
            return nullptr;
        }

        try
        {
            winrt::Windows::Perception::Spatial::SpatialBoundingOrientedBox return_value{ py::converter<winrt::Windows::Foundation::Numerics::float3>::convert_to(_Center), py::converter<winrt::Windows::Foundation::Numerics::float3>::convert_to(_Extents), py::converter<winrt::Windows::Foundation::Numerics::quaternion>::convert_to(_Orientation) };
            return py::convert(return_value);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static void _dealloc_SpatialBoundingOrientedBox(py::wrapper::Windows::Perception::Spatial::SpatialBoundingOrientedBox* self) noexcept
    {
    }

    static PyObject* SpatialBoundingOrientedBox_get_Center(py::wrapper::Windows::Perception::Spatial::SpatialBoundingOrientedBox* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Center);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int SpatialBoundingOrientedBox_set_Center(py::wrapper::Windows::Perception::Spatial::SpatialBoundingOrientedBox* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.Center = py::converter<winrt::Windows::Foundation::Numerics::float3>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* SpatialBoundingOrientedBox_get_Extents(py::wrapper::Windows::Perception::Spatial::SpatialBoundingOrientedBox* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Extents);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int SpatialBoundingOrientedBox_set_Extents(py::wrapper::Windows::Perception::Spatial::SpatialBoundingOrientedBox* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.Extents = py::converter<winrt::Windows::Foundation::Numerics::float3>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* SpatialBoundingOrientedBox_get_Orientation(py::wrapper::Windows::Perception::Spatial::SpatialBoundingOrientedBox* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Orientation);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int SpatialBoundingOrientedBox_set_Orientation(py::wrapper::Windows::Perception::Spatial::SpatialBoundingOrientedBox* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.Orientation = py::converter<winrt::Windows::Foundation::Numerics::quaternion>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyGetSetDef _getset_SpatialBoundingOrientedBox[] = {
        { "center", reinterpret_cast<getter>(SpatialBoundingOrientedBox_get_Center), reinterpret_cast<setter>(SpatialBoundingOrientedBox_set_Center), nullptr, nullptr },
        { "extents", reinterpret_cast<getter>(SpatialBoundingOrientedBox_get_Extents), reinterpret_cast<setter>(SpatialBoundingOrientedBox_set_Extents), nullptr, nullptr },
        { "orientation", reinterpret_cast<getter>(SpatialBoundingOrientedBox_get_Orientation), reinterpret_cast<setter>(SpatialBoundingOrientedBox_set_Orientation), nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SpatialBoundingOrientedBox[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialBoundingOrientedBox) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialBoundingOrientedBox) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialBoundingOrientedBox) },
        { },
    };

    static PyType_Spec type_spec_SpatialBoundingOrientedBox =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialBoundingOrientedBox",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialBoundingOrientedBox),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialBoundingOrientedBox
    };

    // ----- SpatialBoundingSphere struct --------------------
    static constexpr const char* const type_name_SpatialBoundingSphere = "SpatialBoundingSphere";

    PyObject* _new_SpatialBoundingSphere(PyTypeObject* type, PyObject* args, PyObject* kwds)
    {
        auto tuple_size = PyTuple_Size(args);

        if ((tuple_size == 0) && (kwds == nullptr))
        {
            try
            {
                winrt::Windows::Perception::Spatial::SpatialBoundingSphere return_value{};
                return py::convert(return_value);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }

        PyObject* _Center{};
        float _Radius{};

        static const char* kwlist[] = {"center", "radius", nullptr};
        if (!PyArg_ParseTupleAndKeywords(args, kwds, "Of", const_cast<char**>(kwlist), &_Center, &_Radius))
        {
            return nullptr;
        }

        try
        {
            winrt::Windows::Perception::Spatial::SpatialBoundingSphere return_value{ py::converter<winrt::Windows::Foundation::Numerics::float3>::convert_to(_Center), _Radius };
            return py::convert(return_value);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static void _dealloc_SpatialBoundingSphere(py::wrapper::Windows::Perception::Spatial::SpatialBoundingSphere* self) noexcept
    {
    }

    static PyObject* SpatialBoundingSphere_get_Center(py::wrapper::Windows::Perception::Spatial::SpatialBoundingSphere* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Center);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int SpatialBoundingSphere_set_Center(py::wrapper::Windows::Perception::Spatial::SpatialBoundingSphere* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.Center = py::converter<winrt::Windows::Foundation::Numerics::float3>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* SpatialBoundingSphere_get_Radius(py::wrapper::Windows::Perception::Spatial::SpatialBoundingSphere* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Radius);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int SpatialBoundingSphere_set_Radius(py::wrapper::Windows::Perception::Spatial::SpatialBoundingSphere* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.Radius = py::converter<float>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyGetSetDef _getset_SpatialBoundingSphere[] = {
        { "center", reinterpret_cast<getter>(SpatialBoundingSphere_get_Center), reinterpret_cast<setter>(SpatialBoundingSphere_set_Center), nullptr, nullptr },
        { "radius", reinterpret_cast<getter>(SpatialBoundingSphere_get_Radius), reinterpret_cast<setter>(SpatialBoundingSphere_set_Radius), nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SpatialBoundingSphere[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialBoundingSphere) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialBoundingSphere) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialBoundingSphere) },
        { },
    };

    static PyType_Spec type_spec_SpatialBoundingSphere =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialBoundingSphere",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialBoundingSphere),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialBoundingSphere
    };

    // ----- SpatialRay struct --------------------
    static constexpr const char* const type_name_SpatialRay = "SpatialRay";

    PyObject* _new_SpatialRay(PyTypeObject* type, PyObject* args, PyObject* kwds)
    {
        auto tuple_size = PyTuple_Size(args);

        if ((tuple_size == 0) && (kwds == nullptr))
        {
            try
            {
                winrt::Windows::Perception::Spatial::SpatialRay return_value{};
                return py::convert(return_value);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }

        PyObject* _Origin{};
        PyObject* _Direction{};

        static const char* kwlist[] = {"origin", "direction", nullptr};
        if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO", const_cast<char**>(kwlist), &_Origin, &_Direction))
        {
            return nullptr;
        }

        try
        {
            winrt::Windows::Perception::Spatial::SpatialRay return_value{ py::converter<winrt::Windows::Foundation::Numerics::float3>::convert_to(_Origin), py::converter<winrt::Windows::Foundation::Numerics::float3>::convert_to(_Direction) };
            return py::convert(return_value);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static void _dealloc_SpatialRay(py::wrapper::Windows::Perception::Spatial::SpatialRay* self) noexcept
    {
    }

    static PyObject* SpatialRay_get_Origin(py::wrapper::Windows::Perception::Spatial::SpatialRay* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Origin);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int SpatialRay_set_Origin(py::wrapper::Windows::Perception::Spatial::SpatialRay* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.Origin = py::converter<winrt::Windows::Foundation::Numerics::float3>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* SpatialRay_get_Direction(py::wrapper::Windows::Perception::Spatial::SpatialRay* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Direction);
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int SpatialRay_set_Direction(py::wrapper::Windows::Perception::Spatial::SpatialRay* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            self->obj.Direction = py::converter<winrt::Windows::Foundation::Numerics::float3>::convert_to(arg);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyGetSetDef _getset_SpatialRay[] = {
        { "origin", reinterpret_cast<getter>(SpatialRay_get_Origin), reinterpret_cast<setter>(SpatialRay_set_Origin), nullptr, nullptr },
        { "direction", reinterpret_cast<getter>(SpatialRay_get_Direction), reinterpret_cast<setter>(SpatialRay_set_Direction), nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SpatialRay[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SpatialRay) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SpatialRay) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SpatialRay) },
        { },
    };

    static PyType_Spec type_spec_SpatialRay =
    {
        "_winsdk_Windows_Perception_Spatial.SpatialRay",
        sizeof(py::wrapper::Windows::Perception::Spatial::SpatialRay),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SpatialRay
    };

    // ----- Windows.Perception.Spatial Initialization --------------------
    PyDoc_STRVAR(module_doc, "Windows::Perception::Spatial");

    static PyMethodDef module_methods[] = {
        {"_register_SpatialAnchorExportPurpose", register_SpatialAnchorExportPurpose, METH_O, "registers type"},
        {"_register_SpatialEntityWatcherStatus", register_SpatialEntityWatcherStatus, METH_O, "registers type"},
        {"_register_SpatialLocatability", register_SpatialLocatability, METH_O, "registers type"},
        {"_register_SpatialLookDirectionRange", register_SpatialLookDirectionRange, METH_O, "registers type"},
        {"_register_SpatialMovementRange", register_SpatialMovementRange, METH_O, "registers type"},
        {"_register_SpatialPerceptionAccessStatus", register_SpatialPerceptionAccessStatus, 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_SpatialAnchorExportPurpose);
        Py_VISIT(state->type_SpatialEntityWatcherStatus);
        Py_VISIT(state->type_SpatialLocatability);
        Py_VISIT(state->type_SpatialLookDirectionRange);
        Py_VISIT(state->type_SpatialMovementRange);
        Py_VISIT(state->type_SpatialPerceptionAccessStatus);
        Py_VISIT(state->type_SpatialAnchor);
        Py_VISIT(state->type_SpatialAnchorExportSufficiency);
        Py_VISIT(state->type_SpatialAnchorExporter);
        Py_VISIT(state->type_SpatialAnchorManager);
        Py_VISIT(state->type_SpatialAnchorRawCoordinateSystemAdjustedEventArgs);
        Py_VISIT(state->type_SpatialAnchorStore);
        Py_VISIT(state->type_SpatialAnchorTransferManager);
        Py_VISIT(state->type_SpatialBoundingVolume);
        Py_VISIT(state->type_SpatialCoordinateSystem);
        Py_VISIT(state->type_SpatialEntity);
        Py_VISIT(state->type_SpatialEntityAddedEventArgs);
        Py_VISIT(state->type_SpatialEntityRemovedEventArgs);
        Py_VISIT(state->type_SpatialEntityStore);
        Py_VISIT(state->type_SpatialEntityUpdatedEventArgs);
        Py_VISIT(state->type_SpatialEntityWatcher);
        Py_VISIT(state->type_SpatialLocation);
        Py_VISIT(state->type_SpatialLocator);
        Py_VISIT(state->type_SpatialLocatorAttachedFrameOfReference);
        Py_VISIT(state->type_SpatialLocatorPositionalTrackingDeactivatingEventArgs);
        Py_VISIT(state->type_SpatialStageFrameOfReference);
        Py_VISIT(state->type_SpatialStationaryFrameOfReference);
        Py_VISIT(state->type_SpatialBoundingBox);
        Py_VISIT(state->type_SpatialBoundingFrustum);
        Py_VISIT(state->type_SpatialBoundingOrientedBox);
        Py_VISIT(state->type_SpatialBoundingSphere);
        Py_VISIT(state->type_SpatialRay);

        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_SpatialAnchorExportPurpose);
        Py_CLEAR(state->type_SpatialEntityWatcherStatus);
        Py_CLEAR(state->type_SpatialLocatability);
        Py_CLEAR(state->type_SpatialLookDirectionRange);
        Py_CLEAR(state->type_SpatialMovementRange);
        Py_CLEAR(state->type_SpatialPerceptionAccessStatus);
        Py_CLEAR(state->type_SpatialAnchor);
        Py_CLEAR(state->type_SpatialAnchorExportSufficiency);
        Py_CLEAR(state->type_SpatialAnchorExporter);
        Py_CLEAR(state->type_SpatialAnchorManager);
        Py_CLEAR(state->type_SpatialAnchorRawCoordinateSystemAdjustedEventArgs);
        Py_CLEAR(state->type_SpatialAnchorStore);
        Py_CLEAR(state->type_SpatialAnchorTransferManager);
        Py_CLEAR(state->type_SpatialBoundingVolume);
        Py_CLEAR(state->type_SpatialCoordinateSystem);
        Py_CLEAR(state->type_SpatialEntity);
        Py_CLEAR(state->type_SpatialEntityAddedEventArgs);
        Py_CLEAR(state->type_SpatialEntityRemovedEventArgs);
        Py_CLEAR(state->type_SpatialEntityStore);
        Py_CLEAR(state->type_SpatialEntityUpdatedEventArgs);
        Py_CLEAR(state->type_SpatialEntityWatcher);
        Py_CLEAR(state->type_SpatialLocation);
        Py_CLEAR(state->type_SpatialLocator);
        Py_CLEAR(state->type_SpatialLocatorAttachedFrameOfReference);
        Py_CLEAR(state->type_SpatialLocatorPositionalTrackingDeactivatingEventArgs);
        Py_CLEAR(state->type_SpatialStageFrameOfReference);
        Py_CLEAR(state->type_SpatialStationaryFrameOfReference);
        Py_CLEAR(state->type_SpatialBoundingBox);
        Py_CLEAR(state->type_SpatialBoundingFrustum);
        Py_CLEAR(state->type_SpatialBoundingOrientedBox);
        Py_CLEAR(state->type_SpatialBoundingSphere);
        Py_CLEAR(state->type_SpatialRay);

        return 0;
    }


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

} // py::cpp::Windows::Perception::Spatial

PyMODINIT_FUNC PyInit__winsdk_Windows_Perception_Spatial(void) noexcept
{
    using namespace py::cpp::Windows::Perception::Spatial;

    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_SpatialAnchor = py::register_python_type(module.get(), type_name_SpatialAnchor, &type_spec_SpatialAnchor, bases.get(), nullptr);
    if (!state->type_SpatialAnchor)
    {
        return nullptr;
    }

    state->type_SpatialAnchorExportSufficiency = py::register_python_type(module.get(), type_name_SpatialAnchorExportSufficiency, &type_spec_SpatialAnchorExportSufficiency, bases.get(), nullptr);
    if (!state->type_SpatialAnchorExportSufficiency)
    {
        return nullptr;
    }

    state->type_SpatialAnchorExporter = py::register_python_type(module.get(), type_name_SpatialAnchorExporter, &type_spec_SpatialAnchorExporter, bases.get(), nullptr);
    if (!state->type_SpatialAnchorExporter)
    {
        return nullptr;
    }

    state->type_SpatialAnchorManager = py::register_python_type(module.get(), type_name_SpatialAnchorManager, &type_spec_SpatialAnchorManager, nullptr, nullptr);
    if (!state->type_SpatialAnchorManager)
    {
        return nullptr;
    }

    state->type_SpatialAnchorRawCoordinateSystemAdjustedEventArgs = py::register_python_type(module.get(), type_name_SpatialAnchorRawCoordinateSystemAdjustedEventArgs, &type_spec_SpatialAnchorRawCoordinateSystemAdjustedEventArgs, bases.get(), nullptr);
    if (!state->type_SpatialAnchorRawCoordinateSystemAdjustedEventArgs)
    {
        return nullptr;
    }

    state->type_SpatialAnchorStore = py::register_python_type(module.get(), type_name_SpatialAnchorStore, &type_spec_SpatialAnchorStore, bases.get(), nullptr);
    if (!state->type_SpatialAnchorStore)
    {
        return nullptr;
    }

    state->type_SpatialAnchorTransferManager = py::register_python_type(module.get(), type_name_SpatialAnchorTransferManager, &type_spec_SpatialAnchorTransferManager, nullptr, nullptr);
    if (!state->type_SpatialAnchorTransferManager)
    {
        return nullptr;
    }

    state->type_SpatialBoundingVolume = py::register_python_type(module.get(), type_name_SpatialBoundingVolume, &type_spec_SpatialBoundingVolume, bases.get(), nullptr);
    if (!state->type_SpatialBoundingVolume)
    {
        return nullptr;
    }

    state->type_SpatialCoordinateSystem = py::register_python_type(module.get(), type_name_SpatialCoordinateSystem, &type_spec_SpatialCoordinateSystem, bases.get(), nullptr);
    if (!state->type_SpatialCoordinateSystem)
    {
        return nullptr;
    }

    state->type_SpatialEntity = py::register_python_type(module.get(), type_name_SpatialEntity, &type_spec_SpatialEntity, bases.get(), nullptr);
    if (!state->type_SpatialEntity)
    {
        return nullptr;
    }

    state->type_SpatialEntityAddedEventArgs = py::register_python_type(module.get(), type_name_SpatialEntityAddedEventArgs, &type_spec_SpatialEntityAddedEventArgs, bases.get(), nullptr);
    if (!state->type_SpatialEntityAddedEventArgs)
    {
        return nullptr;
    }

    state->type_SpatialEntityRemovedEventArgs = py::register_python_type(module.get(), type_name_SpatialEntityRemovedEventArgs, &type_spec_SpatialEntityRemovedEventArgs, bases.get(), nullptr);
    if (!state->type_SpatialEntityRemovedEventArgs)
    {
        return nullptr;
    }

    py::pyobj_handle type_SpatialEntityStore_Meta{PyType_FromSpec(&type_spec_SpatialEntityStore_Meta)};
    if (!type_SpatialEntityStore_Meta)
    {
        return nullptr;
    }

    state->type_SpatialEntityStore = py::register_python_type(module.get(), type_name_SpatialEntityStore, &type_spec_SpatialEntityStore, bases.get(), reinterpret_cast<PyTypeObject*>(type_SpatialEntityStore_Meta.get()));
    if (!state->type_SpatialEntityStore)
    {
        return nullptr;
    }

    state->type_SpatialEntityUpdatedEventArgs = py::register_python_type(module.get(), type_name_SpatialEntityUpdatedEventArgs, &type_spec_SpatialEntityUpdatedEventArgs, bases.get(), nullptr);
    if (!state->type_SpatialEntityUpdatedEventArgs)
    {
        return nullptr;
    }

    state->type_SpatialEntityWatcher = py::register_python_type(module.get(), type_name_SpatialEntityWatcher, &type_spec_SpatialEntityWatcher, bases.get(), nullptr);
    if (!state->type_SpatialEntityWatcher)
    {
        return nullptr;
    }

    state->type_SpatialLocation = py::register_python_type(module.get(), type_name_SpatialLocation, &type_spec_SpatialLocation, bases.get(), nullptr);
    if (!state->type_SpatialLocation)
    {
        return nullptr;
    }

    state->type_SpatialLocator = py::register_python_type(module.get(), type_name_SpatialLocator, &type_spec_SpatialLocator, bases.get(), nullptr);
    if (!state->type_SpatialLocator)
    {
        return nullptr;
    }

    state->type_SpatialLocatorAttachedFrameOfReference = py::register_python_type(module.get(), type_name_SpatialLocatorAttachedFrameOfReference, &type_spec_SpatialLocatorAttachedFrameOfReference, bases.get(), nullptr);
    if (!state->type_SpatialLocatorAttachedFrameOfReference)
    {
        return nullptr;
    }

    state->type_SpatialLocatorPositionalTrackingDeactivatingEventArgs = py::register_python_type(module.get(), type_name_SpatialLocatorPositionalTrackingDeactivatingEventArgs, &type_spec_SpatialLocatorPositionalTrackingDeactivatingEventArgs, bases.get(), nullptr);
    if (!state->type_SpatialLocatorPositionalTrackingDeactivatingEventArgs)
    {
        return nullptr;
    }

    py::pyobj_handle type_SpatialStageFrameOfReference_Meta{PyType_FromSpec(&type_spec_SpatialStageFrameOfReference_Meta)};
    if (!type_SpatialStageFrameOfReference_Meta)
    {
        return nullptr;
    }

    state->type_SpatialStageFrameOfReference = py::register_python_type(module.get(), type_name_SpatialStageFrameOfReference, &type_spec_SpatialStageFrameOfReference, bases.get(), reinterpret_cast<PyTypeObject*>(type_SpatialStageFrameOfReference_Meta.get()));
    if (!state->type_SpatialStageFrameOfReference)
    {
        return nullptr;
    }

    state->type_SpatialStationaryFrameOfReference = py::register_python_type(module.get(), type_name_SpatialStationaryFrameOfReference, &type_spec_SpatialStationaryFrameOfReference, bases.get(), nullptr);
    if (!state->type_SpatialStationaryFrameOfReference)
    {
        return nullptr;
    }

    state->type_SpatialBoundingBox = py::register_python_type(module.get(), type_name_SpatialBoundingBox, &type_spec_SpatialBoundingBox, bases.get(), nullptr);
    if (!state->type_SpatialBoundingBox)
    {
        return nullptr;
    }

    state->type_SpatialBoundingFrustum = py::register_python_type(module.get(), type_name_SpatialBoundingFrustum, &type_spec_SpatialBoundingFrustum, bases.get(), nullptr);
    if (!state->type_SpatialBoundingFrustum)
    {
        return nullptr;
    }

    state->type_SpatialBoundingOrientedBox = py::register_python_type(module.get(), type_name_SpatialBoundingOrientedBox, &type_spec_SpatialBoundingOrientedBox, bases.get(), nullptr);
    if (!state->type_SpatialBoundingOrientedBox)
    {
        return nullptr;
    }

    state->type_SpatialBoundingSphere = py::register_python_type(module.get(), type_name_SpatialBoundingSphere, &type_spec_SpatialBoundingSphere, bases.get(), nullptr);
    if (!state->type_SpatialBoundingSphere)
    {
        return nullptr;
    }

    state->type_SpatialRay = py::register_python_type(module.get(), type_name_SpatialRay, &type_spec_SpatialRay, bases.get(), nullptr);
    if (!state->type_SpatialRay)
    {
        return nullptr;
    }


    return module.detach();
}

PyObject* py::py_type<winrt::Windows::Perception::Spatial::SpatialAnchorExportPurpose>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialAnchorExportPurpose;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialAnchorExportPurpose is not registered");
        return nullptr;
    }

    return python_type;
}

PyObject* py::py_type<winrt::Windows::Perception::Spatial::SpatialEntityWatcherStatus>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialEntityWatcherStatus;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialEntityWatcherStatus is not registered");
        return nullptr;
    }

    return python_type;
}

PyObject* py::py_type<winrt::Windows::Perception::Spatial::SpatialLocatability>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialLocatability;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialLocatability is not registered");
        return nullptr;
    }

    return python_type;
}

PyObject* py::py_type<winrt::Windows::Perception::Spatial::SpatialLookDirectionRange>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialLookDirectionRange;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialLookDirectionRange is not registered");
        return nullptr;
    }

    return python_type;
}

PyObject* py::py_type<winrt::Windows::Perception::Spatial::SpatialMovementRange>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialMovementRange;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialMovementRange is not registered");
        return nullptr;
    }

    return python_type;
}

PyObject* py::py_type<winrt::Windows::Perception::Spatial::SpatialPerceptionAccessStatus>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialPerceptionAccessStatus;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialPerceptionAccessStatus is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialAnchor>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialAnchor;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialAnchor is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialAnchorExportSufficiency>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialAnchorExportSufficiency;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialAnchorExportSufficiency is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialAnchorExporter>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialAnchorExporter;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialAnchorExporter is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialAnchorManager>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialAnchorManager;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialAnchorManager is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialAnchorRawCoordinateSystemAdjustedEventArgs>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialAnchorRawCoordinateSystemAdjustedEventArgs;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialAnchorRawCoordinateSystemAdjustedEventArgs is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialAnchorStore>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialAnchorStore;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialAnchorStore is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialAnchorTransferManager>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialAnchorTransferManager;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialAnchorTransferManager is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialBoundingVolume>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialBoundingVolume;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialBoundingVolume is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialCoordinateSystem>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialCoordinateSystem;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialCoordinateSystem is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialEntity>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialEntity;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialEntity is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialEntityAddedEventArgs>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialEntityAddedEventArgs;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialEntityAddedEventArgs is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialEntityRemovedEventArgs>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialEntityRemovedEventArgs;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialEntityRemovedEventArgs is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialEntityStore>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialEntityStore;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialEntityStore is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialEntityUpdatedEventArgs>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialEntityUpdatedEventArgs;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialEntityUpdatedEventArgs is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialEntityWatcher>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialEntityWatcher;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialEntityWatcher is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialLocation>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialLocation;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialLocation is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialLocator>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialLocator;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialLocator is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialLocatorAttachedFrameOfReference;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialLocatorAttachedFrameOfReference is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialLocatorPositionalTrackingDeactivatingEventArgs>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialLocatorPositionalTrackingDeactivatingEventArgs;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialLocatorPositionalTrackingDeactivatingEventArgs is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialStageFrameOfReference>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialStageFrameOfReference;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialStageFrameOfReference is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialStationaryFrameOfReference>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialStationaryFrameOfReference;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialStationaryFrameOfReference is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialBoundingBox>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialBoundingBox;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialBoundingBox is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialBoundingFrustum>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialBoundingFrustum;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialBoundingFrustum is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialBoundingOrientedBox>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialBoundingOrientedBox;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialBoundingOrientedBox is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialBoundingSphere>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialBoundingSphere;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialBoundingSphere is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Perception::Spatial::SpatialRay>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Perception::Spatial;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_SpatialRay;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Perception::Spatial::SpatialRay is not registered");
        return nullptr;
    }

    return python_type;
}
