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

#include "py.Windows.Security.Authentication.Identity.Provider.h"


namespace py::cpp::Windows::Security::Authentication::Identity::Provider
{
    // ----- SecondaryAuthenticationFactorAuthentication class --------------------

    static PyObject* _new_SecondaryAuthenticationFactorAuthentication(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthentication>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthentication>::type_name);
        return nullptr;
    }

    static void _dealloc_SecondaryAuthenticationFactorAuthentication(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthentication* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* SecondaryAuthenticationFactorAuthentication_AbortAuthenticationAsync(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthentication* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorAuthentication", L"AbortAuthenticationAsync", 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.AbortAuthenticationAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* SecondaryAuthenticationFactorAuthentication_FinishAuthenticationAsync(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthentication* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorAuthentication", L"FinishAuthenticationAsync", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

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

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

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

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorAuthentication", L"GetAuthenticationStageInfoAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthentication::GetAuthenticationStageInfoAsync());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorAuthentication", L"ShowNotificationMessageAsync", 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::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationMessage>(args, 1);

                return py::convert(winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthentication::ShowNotificationMessageAsync(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorAuthentication", L"StartAuthenticationAsync", 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::Storage::Streams::IBuffer>(args, 1);

                return py::convert(winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthentication::StartAuthenticationAsync(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* SecondaryAuthenticationFactorAuthentication_get_DeviceConfigurationData(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthentication* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorAuthentication", L"DeviceConfigurationData"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* SecondaryAuthenticationFactorAuthentication_get_DeviceNonce(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthentication* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorAuthentication", L"DeviceNonce"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* SecondaryAuthenticationFactorAuthentication_get_ServiceAuthenticationHmac(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthentication* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorAuthentication", L"ServiceAuthenticationHmac"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* SecondaryAuthenticationFactorAuthentication_get_SessionNonce(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthentication* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorAuthentication", L"SessionNonce"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* SecondaryAuthenticationFactorAuthentication_add_AuthenticationStageChanged(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorAuthentication", L"AuthenticationStageChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::EventHandler<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs>>(arg);

            return py::convert(winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthentication::AuthenticationStageChanged(param0));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* SecondaryAuthenticationFactorAuthentication_remove_AuthenticationStageChanged(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorAuthentication", L"AuthenticationStageChanged"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthentication::AuthenticationStageChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_SecondaryAuthenticationFactorAuthentication(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthentication>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_SecondaryAuthenticationFactorAuthentication(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::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthentication>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SecondaryAuthenticationFactorAuthentication[] = {
        { "abort_authentication_async", reinterpret_cast<PyCFunction>(SecondaryAuthenticationFactorAuthentication_AbortAuthenticationAsync), METH_VARARGS, nullptr },
        { "finish_authentication_async", reinterpret_cast<PyCFunction>(SecondaryAuthenticationFactorAuthentication_FinishAuthenticationAsync), METH_VARARGS, nullptr },
        { "add_authentication_stage_changed", reinterpret_cast<PyCFunction>(SecondaryAuthenticationFactorAuthentication_add_AuthenticationStageChanged), METH_O | METH_STATIC, nullptr },
        { "remove_authentication_stage_changed", reinterpret_cast<PyCFunction>(SecondaryAuthenticationFactorAuthentication_remove_AuthenticationStageChanged), METH_O | METH_STATIC, nullptr },
        { "_assign_array_", _assign_array_SecondaryAuthenticationFactorAuthentication, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SecondaryAuthenticationFactorAuthentication), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SecondaryAuthenticationFactorAuthentication[] = {
        { "device_configuration_data", reinterpret_cast<getter>(SecondaryAuthenticationFactorAuthentication_get_DeviceConfigurationData), nullptr, nullptr, nullptr },
        { "device_nonce", reinterpret_cast<getter>(SecondaryAuthenticationFactorAuthentication_get_DeviceNonce), nullptr, nullptr, nullptr },
        { "service_authentication_hmac", reinterpret_cast<getter>(SecondaryAuthenticationFactorAuthentication_get_ServiceAuthenticationHmac), nullptr, nullptr, nullptr },
        { "session_nonce", reinterpret_cast<getter>(SecondaryAuthenticationFactorAuthentication_get_SessionNonce), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SecondaryAuthenticationFactorAuthentication[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SecondaryAuthenticationFactorAuthentication) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SecondaryAuthenticationFactorAuthentication) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SecondaryAuthenticationFactorAuthentication) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SecondaryAuthenticationFactorAuthentication) },
        { },
    };

    static PyType_Spec type_spec_SecondaryAuthenticationFactorAuthentication =
    {
        "winrt._winrt_windows_security_authentication_identity_provider.SecondaryAuthenticationFactorAuthentication",
        sizeof(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthentication),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SecondaryAuthenticationFactorAuthentication
    };

    static PyGetSetDef getset_SecondaryAuthenticationFactorAuthentication_Static[] = {
        { }
    };

    static PyMethodDef methods_SecondaryAuthenticationFactorAuthentication_Static[] = {
        { "get_authentication_stage_info_async", reinterpret_cast<PyCFunction>(SecondaryAuthenticationFactorAuthentication_GetAuthenticationStageInfoAsync), METH_VARARGS, nullptr },
        { "show_notification_message_async", reinterpret_cast<PyCFunction>(SecondaryAuthenticationFactorAuthentication_ShowNotificationMessageAsync), METH_VARARGS, nullptr },
        { "start_authentication_async", reinterpret_cast<PyCFunction>(SecondaryAuthenticationFactorAuthentication_StartAuthenticationAsync), METH_VARARGS, nullptr },
        { }
    };

    static PyType_Slot type_slots_SecondaryAuthenticationFactorAuthentication_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_SecondaryAuthenticationFactorAuthentication_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_SecondaryAuthenticationFactorAuthentication_Static) },
        { }
    };

    static PyType_Spec type_spec_SecondaryAuthenticationFactorAuthentication_Static =
    {
        "winrt._winrt_windows_security_authentication_identity_provider.SecondaryAuthenticationFactorAuthentication_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_SecondaryAuthenticationFactorAuthentication_Static
    };

    // ----- SecondaryAuthenticationFactorAuthenticationResult class --------------------

    static PyObject* _new_SecondaryAuthenticationFactorAuthenticationResult(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationResult>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationResult>::type_name);
        return nullptr;
    }

    static void _dealloc_SecondaryAuthenticationFactorAuthenticationResult(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationResult* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

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

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

    static PyObject* SecondaryAuthenticationFactorAuthenticationResult_get_Status(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationResult* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorAuthenticationResult", 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_SecondaryAuthenticationFactorAuthenticationResult(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationResult>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_SecondaryAuthenticationFactorAuthenticationResult(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::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationResult>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SecondaryAuthenticationFactorAuthenticationResult[] = {
        { "_assign_array_", _assign_array_SecondaryAuthenticationFactorAuthenticationResult, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SecondaryAuthenticationFactorAuthenticationResult), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SecondaryAuthenticationFactorAuthenticationResult[] = {
        { "authentication", reinterpret_cast<getter>(SecondaryAuthenticationFactorAuthenticationResult_get_Authentication), nullptr, nullptr, nullptr },
        { "status", reinterpret_cast<getter>(SecondaryAuthenticationFactorAuthenticationResult_get_Status), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SecondaryAuthenticationFactorAuthenticationResult[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SecondaryAuthenticationFactorAuthenticationResult) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SecondaryAuthenticationFactorAuthenticationResult) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SecondaryAuthenticationFactorAuthenticationResult) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SecondaryAuthenticationFactorAuthenticationResult) },
        { },
    };

    static PyType_Spec type_spec_SecondaryAuthenticationFactorAuthenticationResult =
    {
        "winrt._winrt_windows_security_authentication_identity_provider.SecondaryAuthenticationFactorAuthenticationResult",
        sizeof(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationResult),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SecondaryAuthenticationFactorAuthenticationResult
    };

    // ----- SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs class --------------------

    static PyObject* _new_SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs>::type_name);
        return nullptr;
    }

    static void _dealloc_SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs_get_StageInfo(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs", L"StageInfo"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* _assign_array_SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs(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::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs[] = {
        { "_assign_array_", _assign_array_SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs[] = {
        { "stage_info", reinterpret_cast<getter>(SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs_get_StageInfo), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs) },
        { },
    };

    static PyType_Spec type_spec_SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs =
    {
        "winrt._winrt_windows_security_authentication_identity_provider.SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs",
        sizeof(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs
    };

    // ----- SecondaryAuthenticationFactorAuthenticationStageInfo class --------------------

    static PyObject* _new_SecondaryAuthenticationFactorAuthenticationStageInfo(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationStageInfo>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationStageInfo>::type_name);
        return nullptr;
    }

    static void _dealloc_SecondaryAuthenticationFactorAuthenticationStageInfo(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationStageInfo* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* SecondaryAuthenticationFactorAuthenticationStageInfo_get_DeviceId(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationStageInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorAuthenticationStageInfo", L"DeviceId"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* SecondaryAuthenticationFactorAuthenticationStageInfo_get_Scenario(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationStageInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorAuthenticationStageInfo", L"Scenario"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* SecondaryAuthenticationFactorAuthenticationStageInfo_get_Stage(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationStageInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorAuthenticationStageInfo", L"Stage"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* _assign_array_SecondaryAuthenticationFactorAuthenticationStageInfo(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationStageInfo>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_SecondaryAuthenticationFactorAuthenticationStageInfo(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::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationStageInfo>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SecondaryAuthenticationFactorAuthenticationStageInfo[] = {
        { "_assign_array_", _assign_array_SecondaryAuthenticationFactorAuthenticationStageInfo, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SecondaryAuthenticationFactorAuthenticationStageInfo), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SecondaryAuthenticationFactorAuthenticationStageInfo[] = {
        { "device_id", reinterpret_cast<getter>(SecondaryAuthenticationFactorAuthenticationStageInfo_get_DeviceId), nullptr, nullptr, nullptr },
        { "scenario", reinterpret_cast<getter>(SecondaryAuthenticationFactorAuthenticationStageInfo_get_Scenario), nullptr, nullptr, nullptr },
        { "stage", reinterpret_cast<getter>(SecondaryAuthenticationFactorAuthenticationStageInfo_get_Stage), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SecondaryAuthenticationFactorAuthenticationStageInfo[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SecondaryAuthenticationFactorAuthenticationStageInfo) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SecondaryAuthenticationFactorAuthenticationStageInfo) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SecondaryAuthenticationFactorAuthenticationStageInfo) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SecondaryAuthenticationFactorAuthenticationStageInfo) },
        { },
    };

    static PyType_Spec type_spec_SecondaryAuthenticationFactorAuthenticationStageInfo =
    {
        "winrt._winrt_windows_security_authentication_identity_provider.SecondaryAuthenticationFactorAuthenticationStageInfo",
        sizeof(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorAuthenticationStageInfo),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SecondaryAuthenticationFactorAuthenticationStageInfo
    };

    // ----- SecondaryAuthenticationFactorInfo class --------------------

    static PyObject* _new_SecondaryAuthenticationFactorInfo(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorInfo>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorInfo>::type_name);
        return nullptr;
    }

    static void _dealloc_SecondaryAuthenticationFactorInfo(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorInfo* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* SecondaryAuthenticationFactorInfo_UpdateDevicePresenceAsync(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorInfo* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorInfo", L"UpdateDevicePresenceAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorDevicePresence>(args, 0);

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

    static PyObject* SecondaryAuthenticationFactorInfo_get_DeviceConfigurationData(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorInfo", L"DeviceConfigurationData"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* SecondaryAuthenticationFactorInfo_get_DeviceFriendlyName(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorInfo", L"DeviceFriendlyName"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* SecondaryAuthenticationFactorInfo_get_DeviceId(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorInfo", L"DeviceId"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* SecondaryAuthenticationFactorInfo_get_DeviceModelNumber(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorInfo", L"DeviceModelNumber"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* SecondaryAuthenticationFactorInfo_get_IsAuthenticationSupported(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorInfo", L"IsAuthenticationSupported"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* SecondaryAuthenticationFactorInfo_get_PresenceMonitoringMode(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorInfo* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorInfo", L"PresenceMonitoringMode"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* _assign_array_SecondaryAuthenticationFactorInfo(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorInfo>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_SecondaryAuthenticationFactorInfo(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::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorInfo>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SecondaryAuthenticationFactorInfo[] = {
        { "update_device_presence_async", reinterpret_cast<PyCFunction>(SecondaryAuthenticationFactorInfo_UpdateDevicePresenceAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_SecondaryAuthenticationFactorInfo, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SecondaryAuthenticationFactorInfo), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SecondaryAuthenticationFactorInfo[] = {
        { "device_configuration_data", reinterpret_cast<getter>(SecondaryAuthenticationFactorInfo_get_DeviceConfigurationData), nullptr, nullptr, nullptr },
        { "device_friendly_name", reinterpret_cast<getter>(SecondaryAuthenticationFactorInfo_get_DeviceFriendlyName), nullptr, nullptr, nullptr },
        { "device_id", reinterpret_cast<getter>(SecondaryAuthenticationFactorInfo_get_DeviceId), nullptr, nullptr, nullptr },
        { "device_model_number", reinterpret_cast<getter>(SecondaryAuthenticationFactorInfo_get_DeviceModelNumber), nullptr, nullptr, nullptr },
        { "is_authentication_supported", reinterpret_cast<getter>(SecondaryAuthenticationFactorInfo_get_IsAuthenticationSupported), nullptr, nullptr, nullptr },
        { "presence_monitoring_mode", reinterpret_cast<getter>(SecondaryAuthenticationFactorInfo_get_PresenceMonitoringMode), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SecondaryAuthenticationFactorInfo[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SecondaryAuthenticationFactorInfo) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SecondaryAuthenticationFactorInfo) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SecondaryAuthenticationFactorInfo) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SecondaryAuthenticationFactorInfo) },
        { },
    };

    static PyType_Spec type_spec_SecondaryAuthenticationFactorInfo =
    {
        "winrt._winrt_windows_security_authentication_identity_provider.SecondaryAuthenticationFactorInfo",
        sizeof(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorInfo),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SecondaryAuthenticationFactorInfo
    };

    // ----- SecondaryAuthenticationFactorRegistration class --------------------

    static PyObject* _new_SecondaryAuthenticationFactorRegistration(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistration>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistration>::type_name);
        return nullptr;
    }

    static void _dealloc_SecondaryAuthenticationFactorRegistration(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistration* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* SecondaryAuthenticationFactorRegistration_AbortRegisteringDeviceAsync(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistration* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorRegistration", L"AbortRegisteringDeviceAsync", 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.AbortRegisteringDeviceAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorRegistration", L"FindAllRegisteredDeviceInfoAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorDeviceFindScope>(args, 0);

                return py::convert(winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistration::FindAllRegisteredDeviceInfoAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* SecondaryAuthenticationFactorRegistration_FinishRegisteringDeviceAsync(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistration* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorRegistration", L"FinishRegisteringDeviceAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

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

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

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

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorRegistration", L"IsDevicePresenceMonitoringSupported", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistration::IsDevicePresenceMonitoringSupported());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 3)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorRegistration", L"RegisterDevicePresenceMonitoringAsync", 3))
            {
                py::set_arg_count_version_error(3);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::hstring>(args, 0);
                auto param1 = py::convert_to<winrt::hstring>(args, 1);
                auto param2 = py::convert_to<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorDevicePresenceMonitoringMode>(args, 2);

                return py::convert(winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistration::RegisterDevicePresenceMonitoringAsync(param0, param1, param2));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 6)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorRegistration", L"RegisterDevicePresenceMonitoringAsync", 6))
            {
                py::set_arg_count_version_error(6);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::hstring>(args, 0);
                auto param1 = py::convert_to<winrt::hstring>(args, 1);
                auto param2 = py::convert_to<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorDevicePresenceMonitoringMode>(args, 2);
                auto param3 = py::convert_to<winrt::hstring>(args, 3);
                auto param4 = py::convert_to<winrt::hstring>(args, 4);
                auto param5 = py::convert_to<winrt::Windows::Storage::Streams::IBuffer>(args, 5);

                return py::convert(winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistration::RegisterDevicePresenceMonitoringAsync(param0, param1, param2, param3, param4, param5));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 6)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorRegistration", L"RequestStartRegisteringDeviceAsync", 6))
            {
                py::set_arg_count_version_error(6);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::hstring>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorDeviceCapabilities>(args, 1);
                auto param2 = py::convert_to<winrt::hstring>(args, 2);
                auto param3 = py::convert_to<winrt::hstring>(args, 3);
                auto param4 = py::convert_to<winrt::Windows::Storage::Streams::IBuffer>(args, 4);
                auto param5 = py::convert_to<winrt::Windows::Storage::Streams::IBuffer>(args, 5);

                return py::convert(winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistration::RequestStartRegisteringDeviceAsync(param0, param1, param2, param3, param4, param5));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorRegistration", L"UnregisterDeviceAsync", 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::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistration::UnregisterDeviceAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorRegistration", L"UnregisterDevicePresenceMonitoringAsync", 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::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistration::UnregisterDevicePresenceMonitoringAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorRegistration", L"UpdateDeviceConfigurationDataAsync", 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::Storage::Streams::IBuffer>(args, 1);

                return py::convert(winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistration::UpdateDeviceConfigurationDataAsync(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* _assign_array_SecondaryAuthenticationFactorRegistration(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistration>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_SecondaryAuthenticationFactorRegistration(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::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistration>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SecondaryAuthenticationFactorRegistration[] = {
        { "abort_registering_device_async", reinterpret_cast<PyCFunction>(SecondaryAuthenticationFactorRegistration_AbortRegisteringDeviceAsync), METH_VARARGS, nullptr },
        { "finish_registering_device_async", reinterpret_cast<PyCFunction>(SecondaryAuthenticationFactorRegistration_FinishRegisteringDeviceAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_SecondaryAuthenticationFactorRegistration, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SecondaryAuthenticationFactorRegistration), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SecondaryAuthenticationFactorRegistration[] = {
        { }
    };

    static PyType_Slot _type_slots_SecondaryAuthenticationFactorRegistration[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SecondaryAuthenticationFactorRegistration) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SecondaryAuthenticationFactorRegistration) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SecondaryAuthenticationFactorRegistration) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SecondaryAuthenticationFactorRegistration) },
        { },
    };

    static PyType_Spec type_spec_SecondaryAuthenticationFactorRegistration =
    {
        "winrt._winrt_windows_security_authentication_identity_provider.SecondaryAuthenticationFactorRegistration",
        sizeof(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistration),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SecondaryAuthenticationFactorRegistration
    };

    static PyGetSetDef getset_SecondaryAuthenticationFactorRegistration_Static[] = {
        { }
    };

    static PyMethodDef methods_SecondaryAuthenticationFactorRegistration_Static[] = {
        { "find_all_registered_device_info_async", reinterpret_cast<PyCFunction>(SecondaryAuthenticationFactorRegistration_FindAllRegisteredDeviceInfoAsync), METH_VARARGS, nullptr },
        { "is_device_presence_monitoring_supported", reinterpret_cast<PyCFunction>(SecondaryAuthenticationFactorRegistration_IsDevicePresenceMonitoringSupported), METH_VARARGS, nullptr },
        { "register_device_presence_monitoring_async", reinterpret_cast<PyCFunction>(SecondaryAuthenticationFactorRegistration_RegisterDevicePresenceMonitoringAsync), METH_VARARGS, nullptr },
        { "request_start_registering_device_async", reinterpret_cast<PyCFunction>(SecondaryAuthenticationFactorRegistration_RequestStartRegisteringDeviceAsync), METH_VARARGS, nullptr },
        { "unregister_device_async", reinterpret_cast<PyCFunction>(SecondaryAuthenticationFactorRegistration_UnregisterDeviceAsync), METH_VARARGS, nullptr },
        { "unregister_device_presence_monitoring_async", reinterpret_cast<PyCFunction>(SecondaryAuthenticationFactorRegistration_UnregisterDevicePresenceMonitoringAsync), METH_VARARGS, nullptr },
        { "update_device_configuration_data_async", reinterpret_cast<PyCFunction>(SecondaryAuthenticationFactorRegistration_UpdateDeviceConfigurationDataAsync), METH_VARARGS, nullptr },
        { }
    };

    static PyType_Slot type_slots_SecondaryAuthenticationFactorRegistration_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_SecondaryAuthenticationFactorRegistration_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_SecondaryAuthenticationFactorRegistration_Static) },
        { }
    };

    static PyType_Spec type_spec_SecondaryAuthenticationFactorRegistration_Static =
    {
        "winrt._winrt_windows_security_authentication_identity_provider.SecondaryAuthenticationFactorRegistration_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_SecondaryAuthenticationFactorRegistration_Static
    };

    // ----- SecondaryAuthenticationFactorRegistrationResult class --------------------

    static PyObject* _new_SecondaryAuthenticationFactorRegistrationResult(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistrationResult>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistrationResult>::type_name);
        return nullptr;
    }

    static void _dealloc_SecondaryAuthenticationFactorRegistrationResult(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistrationResult* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* SecondaryAuthenticationFactorRegistrationResult_get_Registration(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistrationResult* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorRegistrationResult", L"Registration"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* SecondaryAuthenticationFactorRegistrationResult_get_Status(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistrationResult* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Security.Authentication.Identity.Provider.SecondaryAuthenticationFactorRegistrationResult", 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_SecondaryAuthenticationFactorRegistrationResult(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistrationResult>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_SecondaryAuthenticationFactorRegistrationResult(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::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistrationResult>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_SecondaryAuthenticationFactorRegistrationResult[] = {
        { "_assign_array_", _assign_array_SecondaryAuthenticationFactorRegistrationResult, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_SecondaryAuthenticationFactorRegistrationResult), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_SecondaryAuthenticationFactorRegistrationResult[] = {
        { "registration", reinterpret_cast<getter>(SecondaryAuthenticationFactorRegistrationResult_get_Registration), nullptr, nullptr, nullptr },
        { "status", reinterpret_cast<getter>(SecondaryAuthenticationFactorRegistrationResult_get_Status), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_SecondaryAuthenticationFactorRegistrationResult[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_SecondaryAuthenticationFactorRegistrationResult) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_SecondaryAuthenticationFactorRegistrationResult) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_SecondaryAuthenticationFactorRegistrationResult) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_SecondaryAuthenticationFactorRegistrationResult) },
        { },
    };

    static PyType_Spec type_spec_SecondaryAuthenticationFactorRegistrationResult =
    {
        "winrt._winrt_windows_security_authentication_identity_provider.SecondaryAuthenticationFactorRegistrationResult",
        sizeof(py::wrapper::Windows::Security::Authentication::Identity::Provider::SecondaryAuthenticationFactorRegistrationResult),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_SecondaryAuthenticationFactorRegistrationResult
    };

    // ----- Windows.Security.Authentication.Identity.Provider Initialization --------------------
    PyDoc_STRVAR(module_doc, "Windows::Security::Authentication::Identity::Provider");


    static PyModuleDef module_def
        = {PyModuleDef_HEAD_INIT,
           "_winrt_windows_security_authentication_identity_provider",
           module_doc,
           0,
           nullptr,
           nullptr,
           nullptr,
           nullptr,
           nullptr};

} // py::cpp::Windows::Security::Authentication::Identity::Provider

PyMODINIT_FUNC PyInit__winrt_windows_security_authentication_identity_provider(void) noexcept
{
    using namespace py::cpp::Windows::Security::Authentication::Identity::Provider;

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

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

    if (!module)
    {
        return nullptr;
    }

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

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

    if (!object_bases)
    {
        return nullptr;
    }

    py::pyobj_handle type_SecondaryAuthenticationFactorAuthentication_Static{PyType_FromSpec(&type_spec_SecondaryAuthenticationFactorAuthentication_Static)};
    if (!type_SecondaryAuthenticationFactorAuthentication_Static)
    {
        return nullptr;
    }

    if (py::register_python_type(module.get(), &type_spec_SecondaryAuthenticationFactorAuthentication, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_SecondaryAuthenticationFactorAuthentication_Static.get())) == -1)
    {
        return nullptr;
    }

    if (py::register_python_type(module.get(), &type_spec_SecondaryAuthenticationFactorAuthenticationResult, object_bases.get(), nullptr) == -1)
    {
        return nullptr;
    }

    if (py::register_python_type(module.get(), &type_spec_SecondaryAuthenticationFactorAuthenticationStageChangedEventArgs, object_bases.get(), nullptr) == -1)
    {
        return nullptr;
    }

    if (py::register_python_type(module.get(), &type_spec_SecondaryAuthenticationFactorAuthenticationStageInfo, object_bases.get(), nullptr) == -1)
    {
        return nullptr;
    }

    if (py::register_python_type(module.get(), &type_spec_SecondaryAuthenticationFactorInfo, object_bases.get(), nullptr) == -1)
    {
        return nullptr;
    }

    py::pyobj_handle type_SecondaryAuthenticationFactorRegistration_Static{PyType_FromSpec(&type_spec_SecondaryAuthenticationFactorRegistration_Static)};
    if (!type_SecondaryAuthenticationFactorRegistration_Static)
    {
        return nullptr;
    }

    if (py::register_python_type(module.get(), &type_spec_SecondaryAuthenticationFactorRegistration, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_SecondaryAuthenticationFactorRegistration_Static.get())) == -1)
    {
        return nullptr;
    }

    if (py::register_python_type(module.get(), &type_spec_SecondaryAuthenticationFactorRegistrationResult, object_bases.get(), nullptr) == -1)
    {
        return nullptr;
    }


    return module.detach();
}
