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

#include "pybase.h"
#include "py.Windows.ApplicationModel.UserActivities.h"


namespace py::cpp::Windows::ApplicationModel::UserActivities
{
    struct module_state
    {
        PyObject* type_UserActivityState;
        PyTypeObject* type_UserActivity;
        PyTypeObject* type_UserActivityAttribution;
        PyTypeObject* type_UserActivityChannel;
        PyTypeObject* type_UserActivityContentInfo;
        PyTypeObject* type_UserActivityRequest;
        PyTypeObject* type_UserActivityRequestManager;
        PyTypeObject* type_UserActivityRequestedEventArgs;
        PyTypeObject* type_UserActivitySession;
        PyTypeObject* type_UserActivitySessionHistoryItem;
        PyTypeObject* type_UserActivityVisualElements;
        PyTypeObject* type_IUserActivityContentInfo;
    };

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

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


        Py_RETURN_NONE;
    }

    // ----- UserActivity class --------------------
    static constexpr const char* const type_name_UserActivity = "UserActivity";

    static PyObject* _new_UserActivity(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::hstring>(args, 0);

                winrt::Windows::ApplicationModel::UserActivities::UserActivity instance{ param0 };
                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_UserActivity(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivity* 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* UserActivity_CreateSession(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivity* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivity", L"CreateSession", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* UserActivity_SaveAsync(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivity* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivity", L"SaveAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* UserActivity_ToJson(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivity* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivity", L"ToJson", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

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

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivity", L"ToJsonArray", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Foundation::Collections::IIterable<winrt::Windows::ApplicationModel::UserActivities::UserActivity>>(args, 0);

                return py::convert(winrt::Windows::ApplicationModel::UserActivities::UserActivity::ToJsonArray(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivity", L"TryParseFromJson", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

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

                return py::convert(winrt::Windows::ApplicationModel::UserActivities::UserActivity::TryParseFromJson(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivity", L"TryParseFromJsonArray", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

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

                return py::convert(winrt::Windows::ApplicationModel::UserActivities::UserActivity::TryParseFromJsonArray(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

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

    static int UserActivity_put_FallbackUri(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivity* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.UserActivities.UserActivity", L"FallbackUri"))
        {
            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::Uri>(arg);

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

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

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

    static int UserActivity_put_ContentUri(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivity* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.UserActivities.UserActivity", L"ContentUri"))
        {
            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::Uri>(arg);

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

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

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

    static int UserActivity_put_ContentType(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivity* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.UserActivities.UserActivity", L"ContentType"))
        {
            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::hstring>(arg);

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

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

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

    static int UserActivity_put_ContentInfo(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivity* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.UserActivities.UserActivity", L"ContentInfo"))
        {
            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::ApplicationModel::UserActivities::IUserActivityContentInfo>(arg);

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

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

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

    static int UserActivity_put_ActivationUri(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivity* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.UserActivities.UserActivity", L"ActivationUri"))
        {
            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::Uri>(arg);

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

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

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

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

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

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

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

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

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

    static int UserActivity_put_IsRoamable(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivity* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.UserActivities.UserActivity", L"IsRoamable"))
        {
            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.IsRoamable(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

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

    static PyObject* _from_UserActivity(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::ApplicationModel::UserActivities::UserActivity>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_UserActivity[] = {
        { "create_session", reinterpret_cast<PyCFunction>(UserActivity_CreateSession), METH_VARARGS, nullptr },
        { "save_async", reinterpret_cast<PyCFunction>(UserActivity_SaveAsync), METH_VARARGS, nullptr },
        { "to_json", reinterpret_cast<PyCFunction>(UserActivity_ToJson), METH_VARARGS, nullptr },
        { "to_json_array", reinterpret_cast<PyCFunction>(UserActivity_ToJsonArray), METH_VARARGS | METH_STATIC, nullptr },
        { "try_parse_from_json", reinterpret_cast<PyCFunction>(UserActivity_TryParseFromJson), METH_VARARGS | METH_STATIC, nullptr },
        { "try_parse_from_json_array", reinterpret_cast<PyCFunction>(UserActivity_TryParseFromJsonArray), METH_VARARGS | METH_STATIC, nullptr },
        { "_assign_array_", _assign_array_UserActivity, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_UserActivity), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_UserActivity[] = {
        { "fallback_uri", reinterpret_cast<getter>(UserActivity_get_FallbackUri), reinterpret_cast<setter>(UserActivity_put_FallbackUri), nullptr, nullptr },
        { "content_uri", reinterpret_cast<getter>(UserActivity_get_ContentUri), reinterpret_cast<setter>(UserActivity_put_ContentUri), nullptr, nullptr },
        { "content_type", reinterpret_cast<getter>(UserActivity_get_ContentType), reinterpret_cast<setter>(UserActivity_put_ContentType), nullptr, nullptr },
        { "content_info", reinterpret_cast<getter>(UserActivity_get_ContentInfo), reinterpret_cast<setter>(UserActivity_put_ContentInfo), nullptr, nullptr },
        { "activation_uri", reinterpret_cast<getter>(UserActivity_get_ActivationUri), reinterpret_cast<setter>(UserActivity_put_ActivationUri), nullptr, nullptr },
        { "activity_id", reinterpret_cast<getter>(UserActivity_get_ActivityId), nullptr, nullptr, nullptr },
        { "state", reinterpret_cast<getter>(UserActivity_get_State), nullptr, nullptr, nullptr },
        { "visual_elements", reinterpret_cast<getter>(UserActivity_get_VisualElements), nullptr, nullptr, nullptr },
        { "is_roamable", reinterpret_cast<getter>(UserActivity_get_IsRoamable), reinterpret_cast<setter>(UserActivity_put_IsRoamable), nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_UserActivity[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_UserActivity) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_UserActivity) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_UserActivity) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_UserActivity) },
        { },
    };

    static PyType_Spec type_spec_UserActivity =
    {
        "_winsdk_Windows_ApplicationModel_UserActivities.UserActivity",
        sizeof(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivity),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_UserActivity
    };

    // ----- UserActivityAttribution class --------------------
    static constexpr const char* const type_name_UserActivityAttribution = "UserActivityAttribution";

    static PyObject* _new_UserActivityAttribution(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::Foundation::Uri>(args, 0);

                winrt::Windows::ApplicationModel::UserActivities::UserActivityAttribution instance{ param0 };
                return py::wrap(instance, type);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 0)
        {
            try
            {
                winrt::Windows::ApplicationModel::UserActivities::UserActivityAttribution instance{  };
                return py::wrap(instance, type);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static void _dealloc_UserActivityAttribution(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityAttribution* 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* UserActivityAttribution_get_IconUri(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityAttribution* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.UserActivities.UserActivityAttribution", L"IconUri"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static int UserActivityAttribution_put_IconUri(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityAttribution* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.UserActivities.UserActivityAttribution", L"IconUri"))
        {
            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::Uri>(arg);

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

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

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

    static int UserActivityAttribution_put_AlternateText(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityAttribution* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.UserActivities.UserActivityAttribution", L"AlternateText"))
        {
            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::hstring>(arg);

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

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

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

    static int UserActivityAttribution_put_AddImageQuery(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityAttribution* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.UserActivities.UserActivityAttribution", L"AddImageQuery"))
        {
            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.AddImageQuery(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

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

    static PyObject* _from_UserActivityAttribution(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::ApplicationModel::UserActivities::UserActivityAttribution>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_UserActivityAttribution[] = {
        { "_assign_array_", _assign_array_UserActivityAttribution, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_UserActivityAttribution), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_UserActivityAttribution[] = {
        { "icon_uri", reinterpret_cast<getter>(UserActivityAttribution_get_IconUri), reinterpret_cast<setter>(UserActivityAttribution_put_IconUri), nullptr, nullptr },
        { "alternate_text", reinterpret_cast<getter>(UserActivityAttribution_get_AlternateText), reinterpret_cast<setter>(UserActivityAttribution_put_AlternateText), nullptr, nullptr },
        { "add_image_query", reinterpret_cast<getter>(UserActivityAttribution_get_AddImageQuery), reinterpret_cast<setter>(UserActivityAttribution_put_AddImageQuery), nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_UserActivityAttribution[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_UserActivityAttribution) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_UserActivityAttribution) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_UserActivityAttribution) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_UserActivityAttribution) },
        { },
    };

    static PyType_Spec type_spec_UserActivityAttribution =
    {
        "_winsdk_Windows_ApplicationModel_UserActivities.UserActivityAttribution",
        sizeof(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityAttribution),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_UserActivityAttribution
    };

    // ----- UserActivityChannel class --------------------
    static constexpr const char* const type_name_UserActivityChannel = "UserActivityChannel";

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

    static void _dealloc_UserActivityChannel(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityChannel* 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* UserActivityChannel_DeleteActivityAsync(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityChannel* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivityChannel", L"DeleteActivityAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

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

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

    static PyObject* UserActivityChannel_DeleteAllActivitiesAsync(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityChannel* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivityChannel", L"DeleteAllActivitiesAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

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

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivityChannel", L"DisableAutoSessionCreation", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                winrt::Windows::ApplicationModel::UserActivities::UserActivityChannel::DisableAutoSessionCreation();
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* UserActivityChannel_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.ApplicationModel.UserActivities.UserActivityChannel", L"GetDefault", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::ApplicationModel::UserActivities::UserActivityChannel::GetDefault());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivityChannel", L"GetForUser", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

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

                return py::convert(winrt::Windows::ApplicationModel::UserActivities::UserActivityChannel::GetForUser(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* UserActivityChannel_GetOrCreateUserActivityAsync(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityChannel* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivityChannel", L"GetOrCreateUserActivityAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

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

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

    static PyObject* UserActivityChannel_GetRecentUserActivitiesAsync(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityChannel* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivityChannel", L"GetRecentUserActivitiesAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

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

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

    static PyObject* UserActivityChannel_GetSessionHistoryItemsForUserActivityAsync(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityChannel* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivityChannel", L"GetSessionHistoryItemsForUserActivityAsync", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

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

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

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

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivityChannel", L"TryGetForWebAccount", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Security::Credentials::WebAccount>(args, 0);

                return py::convert(winrt::Windows::ApplicationModel::UserActivities::UserActivityChannel::TryGetForWebAccount(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

    static PyObject* _from_UserActivityChannel(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::ApplicationModel::UserActivities::UserActivityChannel>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_UserActivityChannel[] = {
        { "delete_activity_async", reinterpret_cast<PyCFunction>(UserActivityChannel_DeleteActivityAsync), METH_VARARGS, nullptr },
        { "delete_all_activities_async", reinterpret_cast<PyCFunction>(UserActivityChannel_DeleteAllActivitiesAsync), METH_VARARGS, nullptr },
        { "disable_auto_session_creation", reinterpret_cast<PyCFunction>(UserActivityChannel_DisableAutoSessionCreation), METH_VARARGS | METH_STATIC, nullptr },
        { "get_default", reinterpret_cast<PyCFunction>(UserActivityChannel_GetDefault), METH_VARARGS | METH_STATIC, nullptr },
        { "get_for_user", reinterpret_cast<PyCFunction>(UserActivityChannel_GetForUser), METH_VARARGS | METH_STATIC, nullptr },
        { "get_or_create_user_activity_async", reinterpret_cast<PyCFunction>(UserActivityChannel_GetOrCreateUserActivityAsync), METH_VARARGS, nullptr },
        { "get_recent_user_activities_async", reinterpret_cast<PyCFunction>(UserActivityChannel_GetRecentUserActivitiesAsync), METH_VARARGS, nullptr },
        { "get_session_history_items_for_user_activity_async", reinterpret_cast<PyCFunction>(UserActivityChannel_GetSessionHistoryItemsForUserActivityAsync), METH_VARARGS, nullptr },
        { "try_get_for_web_account", reinterpret_cast<PyCFunction>(UserActivityChannel_TryGetForWebAccount), METH_VARARGS | METH_STATIC, nullptr },
        { "_assign_array_", _assign_array_UserActivityChannel, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_UserActivityChannel), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_UserActivityChannel[] = {
        { }
    };

    static PyType_Slot _type_slots_UserActivityChannel[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_UserActivityChannel) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_UserActivityChannel) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_UserActivityChannel) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_UserActivityChannel) },
        { },
    };

    static PyType_Spec type_spec_UserActivityChannel =
    {
        "_winsdk_Windows_ApplicationModel_UserActivities.UserActivityChannel",
        sizeof(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityChannel),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_UserActivityChannel
    };

    // ----- UserActivityContentInfo class --------------------
    static constexpr const char* const type_name_UserActivityContentInfo = "UserActivityContentInfo";

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

    static void _dealloc_UserActivityContentInfo(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityContentInfo* 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* UserActivityContentInfo_FromJson(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivityContentInfo", L"FromJson", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

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

                return py::convert(winrt::Windows::ApplicationModel::UserActivities::UserActivityContentInfo::FromJson(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* UserActivityContentInfo_ToJson(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityContentInfo* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivityContentInfo", L"ToJson", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

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

    static PyObject* _from_UserActivityContentInfo(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::ApplicationModel::UserActivities::UserActivityContentInfo>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_UserActivityContentInfo[] = {
        { "from_json", reinterpret_cast<PyCFunction>(UserActivityContentInfo_FromJson), METH_VARARGS | METH_STATIC, nullptr },
        { "to_json", reinterpret_cast<PyCFunction>(UserActivityContentInfo_ToJson), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_UserActivityContentInfo, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_UserActivityContentInfo), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_UserActivityContentInfo[] = {
        { }
    };

    static PyType_Slot _type_slots_UserActivityContentInfo[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_UserActivityContentInfo) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_UserActivityContentInfo) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_UserActivityContentInfo) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_UserActivityContentInfo) },
        { },
    };

    static PyType_Spec type_spec_UserActivityContentInfo =
    {
        "_winsdk_Windows_ApplicationModel_UserActivities.UserActivityContentInfo",
        sizeof(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityContentInfo),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_UserActivityContentInfo
    };

    // ----- UserActivityRequest class --------------------
    static constexpr const char* const type_name_UserActivityRequest = "UserActivityRequest";

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

    static void _dealloc_UserActivityRequest(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityRequest* 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* UserActivityRequest_SetUserActivity(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityRequest* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivityRequest", L"SetUserActivity", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::ApplicationModel::UserActivities::UserActivity>(args, 0);

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

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

    static PyObject* _from_UserActivityRequest(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::ApplicationModel::UserActivities::UserActivityRequest>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_UserActivityRequest[] = {
        { "set_user_activity", reinterpret_cast<PyCFunction>(UserActivityRequest_SetUserActivity), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_UserActivityRequest, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_UserActivityRequest), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_UserActivityRequest[] = {
        { }
    };

    static PyType_Slot _type_slots_UserActivityRequest[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_UserActivityRequest) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_UserActivityRequest) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_UserActivityRequest) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_UserActivityRequest) },
        { },
    };

    static PyType_Spec type_spec_UserActivityRequest =
    {
        "_winsdk_Windows_ApplicationModel_UserActivities.UserActivityRequest",
        sizeof(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityRequest),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_UserActivityRequest
    };

    // ----- UserActivityRequestManager class --------------------
    static constexpr const char* const type_name_UserActivityRequestManager = "UserActivityRequestManager";

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

    static void _dealloc_UserActivityRequestManager(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityRequestManager* 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* UserActivityRequestManager_GetForCurrentView(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivityRequestManager", L"GetForCurrentView", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::ApplicationModel::UserActivities::UserActivityRequestManager::GetForCurrentView());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* UserActivityRequestManager_add_UserActivityRequested(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityRequestManager* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.ApplicationModel.UserActivities.UserActivityRequestManager", L"UserActivityRequested"))
        {
            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::ApplicationModel::UserActivities::UserActivityRequestManager, winrt::Windows::ApplicationModel::UserActivities::UserActivityRequestedEventArgs>>(arg);

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

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

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

    static PyObject* _from_UserActivityRequestManager(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::ApplicationModel::UserActivities::UserActivityRequestManager>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_UserActivityRequestManager[] = {
        { "get_for_current_view", reinterpret_cast<PyCFunction>(UserActivityRequestManager_GetForCurrentView), METH_VARARGS | METH_STATIC, nullptr },
        { "add_user_activity_requested", reinterpret_cast<PyCFunction>(UserActivityRequestManager_add_UserActivityRequested), METH_O, nullptr },
        { "remove_user_activity_requested", reinterpret_cast<PyCFunction>(UserActivityRequestManager_remove_UserActivityRequested), METH_O, nullptr },
        { "_assign_array_", _assign_array_UserActivityRequestManager, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_UserActivityRequestManager), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_UserActivityRequestManager[] = {
        { }
    };

    static PyType_Slot _type_slots_UserActivityRequestManager[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_UserActivityRequestManager) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_UserActivityRequestManager) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_UserActivityRequestManager) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_UserActivityRequestManager) },
        { },
    };

    static PyType_Spec type_spec_UserActivityRequestManager =
    {
        "_winsdk_Windows_ApplicationModel_UserActivities.UserActivityRequestManager",
        sizeof(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityRequestManager),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_UserActivityRequestManager
    };

    // ----- UserActivityRequestedEventArgs class --------------------
    static constexpr const char* const type_name_UserActivityRequestedEventArgs = "UserActivityRequestedEventArgs";

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

    static void _dealloc_UserActivityRequestedEventArgs(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityRequestedEventArgs* 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* UserActivityRequestedEventArgs_GetDeferral(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityRequestedEventArgs* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivityRequestedEventArgs", L"GetDeferral", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

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

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

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

    static PyObject* _from_UserActivityRequestedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::ApplicationModel::UserActivities::UserActivityRequestedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_UserActivityRequestedEventArgs[] = {
        { "get_deferral", reinterpret_cast<PyCFunction>(UserActivityRequestedEventArgs_GetDeferral), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_UserActivityRequestedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_UserActivityRequestedEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_UserActivityRequestedEventArgs[] = {
        { "request", reinterpret_cast<getter>(UserActivityRequestedEventArgs_get_Request), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_UserActivityRequestedEventArgs[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_UserActivityRequestedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_UserActivityRequestedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_UserActivityRequestedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_UserActivityRequestedEventArgs) },
        { },
    };

    static PyType_Spec type_spec_UserActivityRequestedEventArgs =
    {
        "_winsdk_Windows_ApplicationModel_UserActivities.UserActivityRequestedEventArgs",
        sizeof(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityRequestedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_UserActivityRequestedEventArgs
    };

    // ----- UserActivitySession class --------------------
    static constexpr const char* const type_name_UserActivitySession = "UserActivitySession";

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

    static void _dealloc_UserActivitySession(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivitySession* 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* UserActivitySession_Close(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivitySession* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.UserActivitySession", L"Close", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

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

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

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

    static PyObject* _from_UserActivitySession(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::ApplicationModel::UserActivities::UserActivitySession>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _enter_UserActivitySession(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivitySession* self) noexcept
    {
        Py_INCREF(self);
        return reinterpret_cast<PyObject*>(self);
    }

    static PyObject* _exit_UserActivitySession(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivitySession* self) noexcept
    {
        try
        {
            self->obj.Close();
            Py_RETURN_FALSE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_UserActivitySession[] = {
        { "close", reinterpret_cast<PyCFunction>(UserActivitySession_Close), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_UserActivitySession, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_UserActivitySession), METH_O | METH_STATIC, nullptr },
        { "__enter__", reinterpret_cast<PyCFunction>(_enter_UserActivitySession), METH_NOARGS, nullptr },
        { "__exit__",  reinterpret_cast<PyCFunction>(_exit_UserActivitySession), METH_VARARGS, nullptr },
        { }
    };

    static PyGetSetDef _getset_UserActivitySession[] = {
        { "activity_id", reinterpret_cast<getter>(UserActivitySession_get_ActivityId), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_UserActivitySession[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_UserActivitySession) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_UserActivitySession) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_UserActivitySession) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_UserActivitySession) },
        { },
    };

    static PyType_Spec type_spec_UserActivitySession =
    {
        "_winsdk_Windows_ApplicationModel_UserActivities.UserActivitySession",
        sizeof(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivitySession),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_UserActivitySession
    };

    // ----- UserActivitySessionHistoryItem class --------------------
    static constexpr const char* const type_name_UserActivitySessionHistoryItem = "UserActivitySessionHistoryItem";

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

    static void _dealloc_UserActivitySessionHistoryItem(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivitySessionHistoryItem* 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* UserActivitySessionHistoryItem_get_EndTime(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivitySessionHistoryItem* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.UserActivities.UserActivitySessionHistoryItem", L"EndTime"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

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

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

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

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

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

    static PyObject* _from_UserActivitySessionHistoryItem(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::ApplicationModel::UserActivities::UserActivitySessionHistoryItem>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_UserActivitySessionHistoryItem[] = {
        { "_assign_array_", _assign_array_UserActivitySessionHistoryItem, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_UserActivitySessionHistoryItem), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_UserActivitySessionHistoryItem[] = {
        { "end_time", reinterpret_cast<getter>(UserActivitySessionHistoryItem_get_EndTime), nullptr, nullptr, nullptr },
        { "start_time", reinterpret_cast<getter>(UserActivitySessionHistoryItem_get_StartTime), nullptr, nullptr, nullptr },
        { "user_activity", reinterpret_cast<getter>(UserActivitySessionHistoryItem_get_UserActivity), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_UserActivitySessionHistoryItem[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_UserActivitySessionHistoryItem) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_UserActivitySessionHistoryItem) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_UserActivitySessionHistoryItem) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_UserActivitySessionHistoryItem) },
        { },
    };

    static PyType_Spec type_spec_UserActivitySessionHistoryItem =
    {
        "_winsdk_Windows_ApplicationModel_UserActivities.UserActivitySessionHistoryItem",
        sizeof(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivitySessionHistoryItem),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_UserActivitySessionHistoryItem
    };

    // ----- UserActivityVisualElements class --------------------
    static constexpr const char* const type_name_UserActivityVisualElements = "UserActivityVisualElements";

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

    static void _dealloc_UserActivityVisualElements(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityVisualElements* 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* UserActivityVisualElements_get_DisplayText(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityVisualElements* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.UserActivities.UserActivityVisualElements", L"DisplayText"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static int UserActivityVisualElements_put_DisplayText(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityVisualElements* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.UserActivities.UserActivityVisualElements", L"DisplayText"))
        {
            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::hstring>(arg);

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

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

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

    static int UserActivityVisualElements_put_Description(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityVisualElements* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.UserActivities.UserActivityVisualElements", L"Description"))
        {
            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::hstring>(arg);

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

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

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

    static int UserActivityVisualElements_put_Content(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityVisualElements* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.UserActivities.UserActivityVisualElements", L"Content"))
        {
            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::UI::Shell::IAdaptiveCard>(arg);

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

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

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

    static int UserActivityVisualElements_put_BackgroundColor(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityVisualElements* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.UserActivities.UserActivityVisualElements", L"BackgroundColor"))
        {
            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::UI::Color>(arg);

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

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

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

    static int UserActivityVisualElements_put_Attribution(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityVisualElements* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.UserActivities.UserActivityVisualElements", L"Attribution"))
        {
            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::ApplicationModel::UserActivities::UserActivityAttribution>(arg);

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

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

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

    static int UserActivityVisualElements_put_AttributionDisplayText(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityVisualElements* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.UserActivities.UserActivityVisualElements", L"AttributionDisplayText"))
        {
            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::hstring>(arg);

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

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

    static PyObject* _from_UserActivityVisualElements(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::ApplicationModel::UserActivities::UserActivityVisualElements>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_UserActivityVisualElements[] = {
        { "_assign_array_", _assign_array_UserActivityVisualElements, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_UserActivityVisualElements), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_UserActivityVisualElements[] = {
        { "display_text", reinterpret_cast<getter>(UserActivityVisualElements_get_DisplayText), reinterpret_cast<setter>(UserActivityVisualElements_put_DisplayText), nullptr, nullptr },
        { "description", reinterpret_cast<getter>(UserActivityVisualElements_get_Description), reinterpret_cast<setter>(UserActivityVisualElements_put_Description), nullptr, nullptr },
        { "content", reinterpret_cast<getter>(UserActivityVisualElements_get_Content), reinterpret_cast<setter>(UserActivityVisualElements_put_Content), nullptr, nullptr },
        { "background_color", reinterpret_cast<getter>(UserActivityVisualElements_get_BackgroundColor), reinterpret_cast<setter>(UserActivityVisualElements_put_BackgroundColor), nullptr, nullptr },
        { "attribution", reinterpret_cast<getter>(UserActivityVisualElements_get_Attribution), reinterpret_cast<setter>(UserActivityVisualElements_put_Attribution), nullptr, nullptr },
        { "attribution_display_text", reinterpret_cast<getter>(UserActivityVisualElements_get_AttributionDisplayText), reinterpret_cast<setter>(UserActivityVisualElements_put_AttributionDisplayText), nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_UserActivityVisualElements[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_UserActivityVisualElements) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_UserActivityVisualElements) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_UserActivityVisualElements) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_UserActivityVisualElements) },
        { },
    };

    static PyType_Spec type_spec_UserActivityVisualElements =
    {
        "_winsdk_Windows_ApplicationModel_UserActivities.UserActivityVisualElements",
        sizeof(py::wrapper::Windows::ApplicationModel::UserActivities::UserActivityVisualElements),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_UserActivityVisualElements
    };

    // ----- IUserActivityContentInfo interface --------------------
    static constexpr const char* const type_name_IUserActivityContentInfo = "IUserActivityContentInfo";

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

    static void _dealloc_IUserActivityContentInfo(py::wrapper::Windows::ApplicationModel::UserActivities::IUserActivityContentInfo* 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* IUserActivityContentInfo_ToJson(py::wrapper::Windows::ApplicationModel::UserActivities::IUserActivityContentInfo* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserActivities.IUserActivityContentInfo", L"ToJson", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

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

    static PyObject* _from_IUserActivityContentInfo(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::ApplicationModel::UserActivities::IUserActivityContentInfo>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_IUserActivityContentInfo[] = {
        { "to_json", reinterpret_cast<PyCFunction>(IUserActivityContentInfo_ToJson), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_IUserActivityContentInfo, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_IUserActivityContentInfo), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_IUserActivityContentInfo[] = {
        { }
    };

    static PyType_Slot _type_slots_IUserActivityContentInfo[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_IUserActivityContentInfo) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IUserActivityContentInfo) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IUserActivityContentInfo) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IUserActivityContentInfo) },
        { },
    };

    static PyType_Spec type_spec_IUserActivityContentInfo =
    {
        "_winsdk_Windows_ApplicationModel_UserActivities.IUserActivityContentInfo",
        sizeof(py::wrapper::Windows::ApplicationModel::UserActivities::IUserActivityContentInfo),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_IUserActivityContentInfo
    };

    // ----- Windows.ApplicationModel.UserActivities Initialization --------------------
    PyDoc_STRVAR(module_doc, "Windows::ApplicationModel::UserActivities");

    static PyMethodDef module_methods[] = {
        {"_register_UserActivityState", register_UserActivityState, 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_UserActivityState);
        Py_VISIT(state->type_UserActivity);
        Py_VISIT(state->type_UserActivityAttribution);
        Py_VISIT(state->type_UserActivityChannel);
        Py_VISIT(state->type_UserActivityContentInfo);
        Py_VISIT(state->type_UserActivityRequest);
        Py_VISIT(state->type_UserActivityRequestManager);
        Py_VISIT(state->type_UserActivityRequestedEventArgs);
        Py_VISIT(state->type_UserActivitySession);
        Py_VISIT(state->type_UserActivitySessionHistoryItem);
        Py_VISIT(state->type_UserActivityVisualElements);
        Py_VISIT(state->type_IUserActivityContentInfo);

        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_UserActivityState);
        Py_CLEAR(state->type_UserActivity);
        Py_CLEAR(state->type_UserActivityAttribution);
        Py_CLEAR(state->type_UserActivityChannel);
        Py_CLEAR(state->type_UserActivityContentInfo);
        Py_CLEAR(state->type_UserActivityRequest);
        Py_CLEAR(state->type_UserActivityRequestManager);
        Py_CLEAR(state->type_UserActivityRequestedEventArgs);
        Py_CLEAR(state->type_UserActivitySession);
        Py_CLEAR(state->type_UserActivitySessionHistoryItem);
        Py_CLEAR(state->type_UserActivityVisualElements);
        Py_CLEAR(state->type_IUserActivityContentInfo);

        return 0;
    }


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

} // py::cpp::Windows::ApplicationModel::UserActivities

PyMODINIT_FUNC PyInit__winsdk_Windows_ApplicationModel_UserActivities(void) noexcept
{
    using namespace py::cpp::Windows::ApplicationModel::UserActivities;

    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_UserActivity = py::register_python_type(module.get(), type_name_UserActivity, &type_spec_UserActivity, bases.get(), nullptr);
    if (!state->type_UserActivity)
    {
        return nullptr;
    }

    state->type_UserActivityAttribution = py::register_python_type(module.get(), type_name_UserActivityAttribution, &type_spec_UserActivityAttribution, bases.get(), nullptr);
    if (!state->type_UserActivityAttribution)
    {
        return nullptr;
    }

    state->type_UserActivityChannel = py::register_python_type(module.get(), type_name_UserActivityChannel, &type_spec_UserActivityChannel, bases.get(), nullptr);
    if (!state->type_UserActivityChannel)
    {
        return nullptr;
    }

    state->type_UserActivityContentInfo = py::register_python_type(module.get(), type_name_UserActivityContentInfo, &type_spec_UserActivityContentInfo, bases.get(), nullptr);
    if (!state->type_UserActivityContentInfo)
    {
        return nullptr;
    }

    state->type_UserActivityRequest = py::register_python_type(module.get(), type_name_UserActivityRequest, &type_spec_UserActivityRequest, bases.get(), nullptr);
    if (!state->type_UserActivityRequest)
    {
        return nullptr;
    }

    state->type_UserActivityRequestManager = py::register_python_type(module.get(), type_name_UserActivityRequestManager, &type_spec_UserActivityRequestManager, bases.get(), nullptr);
    if (!state->type_UserActivityRequestManager)
    {
        return nullptr;
    }

    state->type_UserActivityRequestedEventArgs = py::register_python_type(module.get(), type_name_UserActivityRequestedEventArgs, &type_spec_UserActivityRequestedEventArgs, bases.get(), nullptr);
    if (!state->type_UserActivityRequestedEventArgs)
    {
        return nullptr;
    }

    state->type_UserActivitySession = py::register_python_type(module.get(), type_name_UserActivitySession, &type_spec_UserActivitySession, bases.get(), nullptr);
    if (!state->type_UserActivitySession)
    {
        return nullptr;
    }

    state->type_UserActivitySessionHistoryItem = py::register_python_type(module.get(), type_name_UserActivitySessionHistoryItem, &type_spec_UserActivitySessionHistoryItem, bases.get(), nullptr);
    if (!state->type_UserActivitySessionHistoryItem)
    {
        return nullptr;
    }

    state->type_UserActivityVisualElements = py::register_python_type(module.get(), type_name_UserActivityVisualElements, &type_spec_UserActivityVisualElements, bases.get(), nullptr);
    if (!state->type_UserActivityVisualElements)
    {
        return nullptr;
    }

    state->type_IUserActivityContentInfo = py::register_python_type(module.get(), type_name_IUserActivityContentInfo, &type_spec_IUserActivityContentInfo, bases.get(), nullptr);
    if (!state->type_IUserActivityContentInfo)
    {
        return nullptr;
    }


    return module.detach();
}

PyObject* py::py_type<winrt::Windows::ApplicationModel::UserActivities::UserActivityState>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::UserActivities;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_UserActivityState;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::ApplicationModel::UserActivities::UserActivityState is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::UserActivities::UserActivity>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::UserActivities;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_UserActivity;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::ApplicationModel::UserActivities::UserActivity is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::UserActivities::UserActivityAttribution>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::UserActivities;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_UserActivityAttribution;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::ApplicationModel::UserActivities::UserActivityAttribution is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::UserActivities::UserActivityChannel>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::UserActivities;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_UserActivityChannel;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::ApplicationModel::UserActivities::UserActivityChannel is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::UserActivities::UserActivityContentInfo>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::UserActivities;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_UserActivityContentInfo;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::ApplicationModel::UserActivities::UserActivityContentInfo is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::UserActivities::UserActivityRequest>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::UserActivities;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_UserActivityRequest;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::ApplicationModel::UserActivities::UserActivityRequest is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::UserActivities::UserActivityRequestManager>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::UserActivities;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_UserActivityRequestManager;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::ApplicationModel::UserActivities::UserActivityRequestManager is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::UserActivities::UserActivityRequestedEventArgs>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::UserActivities;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_UserActivityRequestedEventArgs;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::ApplicationModel::UserActivities::UserActivityRequestedEventArgs is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::UserActivities::UserActivitySession>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::UserActivities;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_UserActivitySession;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::ApplicationModel::UserActivities::UserActivitySession is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::UserActivities::UserActivitySessionHistoryItem>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::UserActivities;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_UserActivitySessionHistoryItem;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::ApplicationModel::UserActivities::UserActivitySessionHistoryItem is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::UserActivities::UserActivityVisualElements>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::UserActivities;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_UserActivityVisualElements;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::ApplicationModel::UserActivities::UserActivityVisualElements is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::UserActivities::IUserActivityContentInfo>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::UserActivities;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_IUserActivityContentInfo;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::ApplicationModel::UserActivities::IUserActivityContentInfo is not registered");
        return nullptr;
    }

    return python_type;
}
