// 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.AppService.h"


namespace py::cpp::Windows::ApplicationModel::AppService
{
    struct module_state
    {
        PyObject* type_AppServiceClosedStatus;
        PyObject* type_AppServiceConnectionStatus;
        PyObject* type_AppServiceResponseStatus;
        PyObject* type_StatelessAppServiceResponseStatus;
        PyTypeObject* type_AppServiceCatalog;
        PyTypeObject* type_AppServiceClosedEventArgs;
        PyTypeObject* type_AppServiceConnection;
        PyTypeObject* type_AppServiceDeferral;
        PyTypeObject* type_AppServiceRequest;
        PyTypeObject* type_AppServiceRequestReceivedEventArgs;
        PyTypeObject* type_AppServiceResponse;
        PyTypeObject* type_AppServiceTriggerDetails;
        PyTypeObject* type_StatelessAppServiceResponse;
    };

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

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


        Py_RETURN_NONE;
    }

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

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


        Py_RETURN_NONE;
    }

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

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


        Py_RETURN_NONE;
    }

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

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


        Py_RETURN_NONE;
    }

    // ----- AppServiceCatalog class --------------------
    static constexpr const char* const type_name_AppServiceCatalog = "AppServiceCatalog";

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

    static PyObject* AppServiceCatalog_FindAppServiceProvidersAsync(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.AppService.AppServiceCatalog", L"FindAppServiceProvidersAsync", 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::AppService::AppServiceCatalog::FindAppServiceProvidersAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyMethodDef _methods_AppServiceCatalog[] = {
        { "find_app_service_providers_async", reinterpret_cast<PyCFunction>(AppServiceCatalog_FindAppServiceProvidersAsync), METH_VARARGS | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_AppServiceCatalog[] = {
        { }
    };

    static PyType_Slot _type_slots_AppServiceCatalog[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_AppServiceCatalog) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_AppServiceCatalog) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_AppServiceCatalog) },
        { },
    };

    static PyType_Spec type_spec_AppServiceCatalog =
    {
        "_winsdk_Windows_ApplicationModel_AppService.AppServiceCatalog",
        0,
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_AppServiceCatalog
    };

    // ----- AppServiceClosedEventArgs class --------------------
    static constexpr const char* const type_name_AppServiceClosedEventArgs = "AppServiceClosedEventArgs";

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

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

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

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

    static PyObject* _from_AppServiceClosedEventArgs(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::AppService::AppServiceClosedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_AppServiceClosedEventArgs[] = {
        { "_assign_array_", _assign_array_AppServiceClosedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_AppServiceClosedEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

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

    static PyType_Slot _type_slots_AppServiceClosedEventArgs[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_AppServiceClosedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_AppServiceClosedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_AppServiceClosedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_AppServiceClosedEventArgs) },
        { },
    };

    static PyType_Spec type_spec_AppServiceClosedEventArgs =
    {
        "_winsdk_Windows_ApplicationModel_AppService.AppServiceClosedEventArgs",
        sizeof(py::wrapper::Windows::ApplicationModel::AppService::AppServiceClosedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_AppServiceClosedEventArgs
    };

    // ----- AppServiceConnection class --------------------
    static constexpr const char* const type_name_AppServiceConnection = "AppServiceConnection";

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

        auto arg_count = PyTuple_Size(args);
        if (arg_count == 0)
        {
            try
            {
                winrt::Windows::ApplicationModel::AppService::AppServiceConnection 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_AppServiceConnection(py::wrapper::Windows::ApplicationModel::AppService::AppServiceConnection* 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* AppServiceConnection_Close(py::wrapper::Windows::ApplicationModel::AppService::AppServiceConnection* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

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

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

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

    static PyObject* AppServiceConnection_OpenRemoteAsync(py::wrapper::Windows::ApplicationModel::AppService::AppServiceConnection* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

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

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

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

    static PyObject* AppServiceConnection_SendMessageAsync(py::wrapper::Windows::ApplicationModel::AppService::AppServiceConnection* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

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

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

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

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

        if (arg_count == 3)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.AppService.AppServiceConnection", L"SendStatelessMessageAsync", 3))
            {
                py::set_arg_count_version_error(3);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::ApplicationModel::AppService::AppServiceConnection>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::System::RemoteSystems::RemoteSystemConnectionRequest>(args, 1);
                auto param2 = py::convert_to<winrt::Windows::Foundation::Collections::ValueSet>(args, 2);

                return py::convert(winrt::Windows::ApplicationModel::AppService::AppServiceConnection::SendStatelessMessageAsync(param0, param1, param2));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

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

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

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

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

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

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

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

    static int AppServiceConnection_put_User(py::wrapper::Windows::ApplicationModel::AppService::AppServiceConnection* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.AppService.AppServiceConnection", L"User"))
        {
            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::System::User>(arg);

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

    static PyObject* AppServiceConnection_add_RequestReceived(py::wrapper::Windows::ApplicationModel::AppService::AppServiceConnection* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.ApplicationModel.AppService.AppServiceConnection", L"RequestReceived"))
        {
            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::AppService::AppServiceConnection, winrt::Windows::ApplicationModel::AppService::AppServiceRequestReceivedEventArgs>>(arg);

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

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

    static PyObject* AppServiceConnection_add_ServiceClosed(py::wrapper::Windows::ApplicationModel::AppService::AppServiceConnection* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.ApplicationModel.AppService.AppServiceConnection", L"ServiceClosed"))
        {
            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::AppService::AppServiceConnection, winrt::Windows::ApplicationModel::AppService::AppServiceClosedEventArgs>>(arg);

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

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

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

    static PyObject* _from_AppServiceConnection(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::AppService::AppServiceConnection>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _enter_AppServiceConnection(py::wrapper::Windows::ApplicationModel::AppService::AppServiceConnection* self) noexcept
    {
        Py_INCREF(self);
        return reinterpret_cast<PyObject*>(self);
    }

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

    static PyMethodDef _methods_AppServiceConnection[] = {
        { "close", reinterpret_cast<PyCFunction>(AppServiceConnection_Close), METH_VARARGS, nullptr },
        { "open_async", reinterpret_cast<PyCFunction>(AppServiceConnection_OpenAsync), METH_VARARGS, nullptr },
        { "open_remote_async", reinterpret_cast<PyCFunction>(AppServiceConnection_OpenRemoteAsync), METH_VARARGS, nullptr },
        { "send_message_async", reinterpret_cast<PyCFunction>(AppServiceConnection_SendMessageAsync), METH_VARARGS, nullptr },
        { "send_stateless_message_async", reinterpret_cast<PyCFunction>(AppServiceConnection_SendStatelessMessageAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "add_request_received", reinterpret_cast<PyCFunction>(AppServiceConnection_add_RequestReceived), METH_O, nullptr },
        { "remove_request_received", reinterpret_cast<PyCFunction>(AppServiceConnection_remove_RequestReceived), METH_O, nullptr },
        { "add_service_closed", reinterpret_cast<PyCFunction>(AppServiceConnection_add_ServiceClosed), METH_O, nullptr },
        { "remove_service_closed", reinterpret_cast<PyCFunction>(AppServiceConnection_remove_ServiceClosed), METH_O, nullptr },
        { "_assign_array_", _assign_array_AppServiceConnection, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_AppServiceConnection), METH_O | METH_STATIC, nullptr },
        { "__enter__", reinterpret_cast<PyCFunction>(_enter_AppServiceConnection), METH_NOARGS, nullptr },
        { "__exit__",  reinterpret_cast<PyCFunction>(_exit_AppServiceConnection), METH_VARARGS, nullptr },
        { }
    };

    static PyGetSetDef _getset_AppServiceConnection[] = {
        { "package_family_name", reinterpret_cast<getter>(AppServiceConnection_get_PackageFamilyName), reinterpret_cast<setter>(AppServiceConnection_put_PackageFamilyName), nullptr, nullptr },
        { "app_service_name", reinterpret_cast<getter>(AppServiceConnection_get_AppServiceName), reinterpret_cast<setter>(AppServiceConnection_put_AppServiceName), nullptr, nullptr },
        { "user", reinterpret_cast<getter>(AppServiceConnection_get_User), reinterpret_cast<setter>(AppServiceConnection_put_User), nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_AppServiceConnection[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_AppServiceConnection) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_AppServiceConnection) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_AppServiceConnection) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_AppServiceConnection) },
        { },
    };

    static PyType_Spec type_spec_AppServiceConnection =
    {
        "_winsdk_Windows_ApplicationModel_AppService.AppServiceConnection",
        sizeof(py::wrapper::Windows::ApplicationModel::AppService::AppServiceConnection),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_AppServiceConnection
    };

    // ----- AppServiceDeferral class --------------------
    static constexpr const char* const type_name_AppServiceDeferral = "AppServiceDeferral";

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

    static void _dealloc_AppServiceDeferral(py::wrapper::Windows::ApplicationModel::AppService::AppServiceDeferral* 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* AppServiceDeferral_Complete(py::wrapper::Windows::ApplicationModel::AppService::AppServiceDeferral* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

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

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

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

    static PyObject* _from_AppServiceDeferral(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::AppService::AppServiceDeferral>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_AppServiceDeferral[] = {
        { "complete", reinterpret_cast<PyCFunction>(AppServiceDeferral_Complete), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_AppServiceDeferral, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_AppServiceDeferral), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_AppServiceDeferral[] = {
        { }
    };

    static PyType_Slot _type_slots_AppServiceDeferral[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_AppServiceDeferral) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_AppServiceDeferral) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_AppServiceDeferral) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_AppServiceDeferral) },
        { },
    };

    static PyType_Spec type_spec_AppServiceDeferral =
    {
        "_winsdk_Windows_ApplicationModel_AppService.AppServiceDeferral",
        sizeof(py::wrapper::Windows::ApplicationModel::AppService::AppServiceDeferral),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_AppServiceDeferral
    };

    // ----- AppServiceRequest class --------------------
    static constexpr const char* const type_name_AppServiceRequest = "AppServiceRequest";

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

    static void _dealloc_AppServiceRequest(py::wrapper::Windows::ApplicationModel::AppService::AppServiceRequest* 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* AppServiceRequest_SendResponseAsync(py::wrapper::Windows::ApplicationModel::AppService::AppServiceRequest* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

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

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

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

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

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

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

    static PyObject* _from_AppServiceRequest(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::AppService::AppServiceRequest>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_AppServiceRequest[] = {
        { "send_response_async", reinterpret_cast<PyCFunction>(AppServiceRequest_SendResponseAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_AppServiceRequest, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_AppServiceRequest), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_AppServiceRequest[] = {
        { "message", reinterpret_cast<getter>(AppServiceRequest_get_Message), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_AppServiceRequest[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_AppServiceRequest) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_AppServiceRequest) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_AppServiceRequest) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_AppServiceRequest) },
        { },
    };

    static PyType_Spec type_spec_AppServiceRequest =
    {
        "_winsdk_Windows_ApplicationModel_AppService.AppServiceRequest",
        sizeof(py::wrapper::Windows::ApplicationModel::AppService::AppServiceRequest),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_AppServiceRequest
    };

    // ----- AppServiceRequestReceivedEventArgs class --------------------
    static constexpr const char* const type_name_AppServiceRequestReceivedEventArgs = "AppServiceRequestReceivedEventArgs";

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

    static void _dealloc_AppServiceRequestReceivedEventArgs(py::wrapper::Windows::ApplicationModel::AppService::AppServiceRequestReceivedEventArgs* 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* AppServiceRequestReceivedEventArgs_GetDeferral(py::wrapper::Windows::ApplicationModel::AppService::AppServiceRequestReceivedEventArgs* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.AppService.AppServiceRequestReceivedEventArgs", 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* AppServiceRequestReceivedEventArgs_get_Request(py::wrapper::Windows::ApplicationModel::AppService::AppServiceRequestReceivedEventArgs* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.AppService.AppServiceRequestReceivedEventArgs", 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_AppServiceRequestReceivedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::ApplicationModel::AppService::AppServiceRequestReceivedEventArgs>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_AppServiceRequestReceivedEventArgs(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::AppService::AppServiceRequestReceivedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_AppServiceRequestReceivedEventArgs[] = {
        { "get_deferral", reinterpret_cast<PyCFunction>(AppServiceRequestReceivedEventArgs_GetDeferral), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_AppServiceRequestReceivedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_AppServiceRequestReceivedEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

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

    static PyType_Slot _type_slots_AppServiceRequestReceivedEventArgs[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_AppServiceRequestReceivedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_AppServiceRequestReceivedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_AppServiceRequestReceivedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_AppServiceRequestReceivedEventArgs) },
        { },
    };

    static PyType_Spec type_spec_AppServiceRequestReceivedEventArgs =
    {
        "_winsdk_Windows_ApplicationModel_AppService.AppServiceRequestReceivedEventArgs",
        sizeof(py::wrapper::Windows::ApplicationModel::AppService::AppServiceRequestReceivedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_AppServiceRequestReceivedEventArgs
    };

    // ----- AppServiceResponse class --------------------
    static constexpr const char* const type_name_AppServiceResponse = "AppServiceResponse";

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

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

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

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

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

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

    static PyObject* _from_AppServiceResponse(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::AppService::AppServiceResponse>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_AppServiceResponse[] = {
        { "_assign_array_", _assign_array_AppServiceResponse, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_AppServiceResponse), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_AppServiceResponse[] = {
        { "message", reinterpret_cast<getter>(AppServiceResponse_get_Message), nullptr, nullptr, nullptr },
        { "status", reinterpret_cast<getter>(AppServiceResponse_get_Status), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_AppServiceResponse[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_AppServiceResponse) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_AppServiceResponse) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_AppServiceResponse) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_AppServiceResponse) },
        { },
    };

    static PyType_Spec type_spec_AppServiceResponse =
    {
        "_winsdk_Windows_ApplicationModel_AppService.AppServiceResponse",
        sizeof(py::wrapper::Windows::ApplicationModel::AppService::AppServiceResponse),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_AppServiceResponse
    };

    // ----- AppServiceTriggerDetails class --------------------
    static constexpr const char* const type_name_AppServiceTriggerDetails = "AppServiceTriggerDetails";

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

    static void _dealloc_AppServiceTriggerDetails(py::wrapper::Windows::ApplicationModel::AppService::AppServiceTriggerDetails* 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* AppServiceTriggerDetails_CheckCallerForCapabilityAsync(py::wrapper::Windows::ApplicationModel::AppService::AppServiceTriggerDetails* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.AppService.AppServiceTriggerDetails", L"CheckCallerForCapabilityAsync", 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.CheckCallerForCapabilityAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

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

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

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

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

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

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

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

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

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

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

    static PyObject* _from_AppServiceTriggerDetails(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::AppService::AppServiceTriggerDetails>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_AppServiceTriggerDetails[] = {
        { "check_caller_for_capability_async", reinterpret_cast<PyCFunction>(AppServiceTriggerDetails_CheckCallerForCapabilityAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_AppServiceTriggerDetails, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_AppServiceTriggerDetails), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_AppServiceTriggerDetails[] = {
        { "app_service_connection", reinterpret_cast<getter>(AppServiceTriggerDetails_get_AppServiceConnection), nullptr, nullptr, nullptr },
        { "caller_package_family_name", reinterpret_cast<getter>(AppServiceTriggerDetails_get_CallerPackageFamilyName), nullptr, nullptr, nullptr },
        { "name", reinterpret_cast<getter>(AppServiceTriggerDetails_get_Name), nullptr, nullptr, nullptr },
        { "is_remote_system_connection", reinterpret_cast<getter>(AppServiceTriggerDetails_get_IsRemoteSystemConnection), nullptr, nullptr, nullptr },
        { "caller_remote_connection_token", reinterpret_cast<getter>(AppServiceTriggerDetails_get_CallerRemoteConnectionToken), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_AppServiceTriggerDetails[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_AppServiceTriggerDetails) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_AppServiceTriggerDetails) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_AppServiceTriggerDetails) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_AppServiceTriggerDetails) },
        { },
    };

    static PyType_Spec type_spec_AppServiceTriggerDetails =
    {
        "_winsdk_Windows_ApplicationModel_AppService.AppServiceTriggerDetails",
        sizeof(py::wrapper::Windows::ApplicationModel::AppService::AppServiceTriggerDetails),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_AppServiceTriggerDetails
    };

    // ----- StatelessAppServiceResponse class --------------------
    static constexpr const char* const type_name_StatelessAppServiceResponse = "StatelessAppServiceResponse";

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

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

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

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

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

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

    static PyObject* _from_StatelessAppServiceResponse(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::AppService::StatelessAppServiceResponse>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_StatelessAppServiceResponse[] = {
        { "_assign_array_", _assign_array_StatelessAppServiceResponse, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_StatelessAppServiceResponse), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_StatelessAppServiceResponse[] = {
        { "message", reinterpret_cast<getter>(StatelessAppServiceResponse_get_Message), nullptr, nullptr, nullptr },
        { "status", reinterpret_cast<getter>(StatelessAppServiceResponse_get_Status), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_StatelessAppServiceResponse[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_StatelessAppServiceResponse) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_StatelessAppServiceResponse) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_StatelessAppServiceResponse) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_StatelessAppServiceResponse) },
        { },
    };

    static PyType_Spec type_spec_StatelessAppServiceResponse =
    {
        "_winsdk_Windows_ApplicationModel_AppService.StatelessAppServiceResponse",
        sizeof(py::wrapper::Windows::ApplicationModel::AppService::StatelessAppServiceResponse),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_StatelessAppServiceResponse
    };

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

    static PyMethodDef module_methods[] = {
        {"_register_AppServiceClosedStatus", register_AppServiceClosedStatus, METH_O, "registers type"},
        {"_register_AppServiceConnectionStatus", register_AppServiceConnectionStatus, METH_O, "registers type"},
        {"_register_AppServiceResponseStatus", register_AppServiceResponseStatus, METH_O, "registers type"},
        {"_register_StatelessAppServiceResponseStatus", register_StatelessAppServiceResponseStatus, 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_AppServiceClosedStatus);
        Py_VISIT(state->type_AppServiceConnectionStatus);
        Py_VISIT(state->type_AppServiceResponseStatus);
        Py_VISIT(state->type_StatelessAppServiceResponseStatus);
        Py_VISIT(state->type_AppServiceCatalog);
        Py_VISIT(state->type_AppServiceClosedEventArgs);
        Py_VISIT(state->type_AppServiceConnection);
        Py_VISIT(state->type_AppServiceDeferral);
        Py_VISIT(state->type_AppServiceRequest);
        Py_VISIT(state->type_AppServiceRequestReceivedEventArgs);
        Py_VISIT(state->type_AppServiceResponse);
        Py_VISIT(state->type_AppServiceTriggerDetails);
        Py_VISIT(state->type_StatelessAppServiceResponse);

        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_AppServiceClosedStatus);
        Py_CLEAR(state->type_AppServiceConnectionStatus);
        Py_CLEAR(state->type_AppServiceResponseStatus);
        Py_CLEAR(state->type_StatelessAppServiceResponseStatus);
        Py_CLEAR(state->type_AppServiceCatalog);
        Py_CLEAR(state->type_AppServiceClosedEventArgs);
        Py_CLEAR(state->type_AppServiceConnection);
        Py_CLEAR(state->type_AppServiceDeferral);
        Py_CLEAR(state->type_AppServiceRequest);
        Py_CLEAR(state->type_AppServiceRequestReceivedEventArgs);
        Py_CLEAR(state->type_AppServiceResponse);
        Py_CLEAR(state->type_AppServiceTriggerDetails);
        Py_CLEAR(state->type_StatelessAppServiceResponse);

        return 0;
    }


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

} // py::cpp::Windows::ApplicationModel::AppService

PyMODINIT_FUNC PyInit__winsdk_Windows_ApplicationModel_AppService(void) noexcept
{
    using namespace py::cpp::Windows::ApplicationModel::AppService;

    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_AppServiceCatalog = py::register_python_type(module.get(), type_name_AppServiceCatalog, &type_spec_AppServiceCatalog, nullptr, nullptr);
    if (!state->type_AppServiceCatalog)
    {
        return nullptr;
    }

    state->type_AppServiceClosedEventArgs = py::register_python_type(module.get(), type_name_AppServiceClosedEventArgs, &type_spec_AppServiceClosedEventArgs, bases.get(), nullptr);
    if (!state->type_AppServiceClosedEventArgs)
    {
        return nullptr;
    }

    state->type_AppServiceConnection = py::register_python_type(module.get(), type_name_AppServiceConnection, &type_spec_AppServiceConnection, bases.get(), nullptr);
    if (!state->type_AppServiceConnection)
    {
        return nullptr;
    }

    state->type_AppServiceDeferral = py::register_python_type(module.get(), type_name_AppServiceDeferral, &type_spec_AppServiceDeferral, bases.get(), nullptr);
    if (!state->type_AppServiceDeferral)
    {
        return nullptr;
    }

    state->type_AppServiceRequest = py::register_python_type(module.get(), type_name_AppServiceRequest, &type_spec_AppServiceRequest, bases.get(), nullptr);
    if (!state->type_AppServiceRequest)
    {
        return nullptr;
    }

    state->type_AppServiceRequestReceivedEventArgs = py::register_python_type(module.get(), type_name_AppServiceRequestReceivedEventArgs, &type_spec_AppServiceRequestReceivedEventArgs, bases.get(), nullptr);
    if (!state->type_AppServiceRequestReceivedEventArgs)
    {
        return nullptr;
    }

    state->type_AppServiceResponse = py::register_python_type(module.get(), type_name_AppServiceResponse, &type_spec_AppServiceResponse, bases.get(), nullptr);
    if (!state->type_AppServiceResponse)
    {
        return nullptr;
    }

    state->type_AppServiceTriggerDetails = py::register_python_type(module.get(), type_name_AppServiceTriggerDetails, &type_spec_AppServiceTriggerDetails, bases.get(), nullptr);
    if (!state->type_AppServiceTriggerDetails)
    {
        return nullptr;
    }

    state->type_StatelessAppServiceResponse = py::register_python_type(module.get(), type_name_StatelessAppServiceResponse, &type_spec_StatelessAppServiceResponse, bases.get(), nullptr);
    if (!state->type_StatelessAppServiceResponse)
    {
        return nullptr;
    }


    return module.detach();
}

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

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_AppServiceClosedStatus;

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

    return python_type;
}

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

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_AppServiceConnectionStatus;

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

    return python_type;
}

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

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_AppServiceResponseStatus;

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

    return python_type;
}

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

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_StatelessAppServiceResponseStatus;

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

    return python_type;
}

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

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_AppServiceCatalog;

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

    return python_type;
}

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

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_AppServiceClosedEventArgs;

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

    return python_type;
}

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

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_AppServiceConnection;

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

    return python_type;
}

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

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_AppServiceDeferral;

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

    return python_type;
}

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

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_AppServiceRequest;

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

    return python_type;
}

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

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_AppServiceRequestReceivedEventArgs;

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

    return python_type;
}

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

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_AppServiceResponse;

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

    return python_type;
}

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

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_AppServiceTriggerDetails;

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

    return python_type;
}

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

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_StatelessAppServiceResponse;

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

    return python_type;
}
