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

#include "py.Windows.Devices.WiFi.h"

namespace py::cpp::Windows::Devices::WiFi
{
    // ----- WiFiAdapter class --------------------

    static PyObject* _new_WiFiAdapter(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Devices::WiFi::WiFiAdapter>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::WiFi::WiFiAdapter>::type_name);
        return nullptr;
    }

    static void _dealloc_WiFiAdapter(py::wrapper::Windows::Devices::WiFi::WiFiAdapter* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* WiFiAdapter_ConnectAsync(py::wrapper::Windows::Devices::WiFi::WiFiAdapter* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 2)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.WiFi.WiFiAdapter", L"ConnectAsync", 2);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(2);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Devices::WiFi::WiFiAvailableNetwork>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Devices::WiFi::WiFiReconnectionKind>(args, 1);

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.ConnectAsync(param0, param1);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* WiFiAdapter_ConnectWithPasswordCredentialAndSsidAndConnectionMethodAsync(py::wrapper::Windows::Devices::WiFi::WiFiAdapter* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 5)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.WiFi.WiFiAdapter", L"ConnectAsync", 5);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(5);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Devices::WiFi::WiFiAvailableNetwork>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Devices::WiFi::WiFiReconnectionKind>(args, 1);
                auto param2 = py::convert_to<winrt::Windows::Security::Credentials::PasswordCredential>(args, 2);
                auto param3 = py::convert_to<winrt::hstring>(args, 3);
                auto param4 = py::convert_to<winrt::Windows::Devices::WiFi::WiFiConnectionMethod>(args, 4);

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.ConnectAsync(param0, param1, param2, param3, param4);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* WiFiAdapter_ConnectWithPasswordCredentialAndSsidAsync(py::wrapper::Windows::Devices::WiFi::WiFiAdapter* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 4)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.WiFi.WiFiAdapter", L"ConnectAsync", 4);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(4);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Devices::WiFi::WiFiAvailableNetwork>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Devices::WiFi::WiFiReconnectionKind>(args, 1);
                auto param2 = py::convert_to<winrt::Windows::Security::Credentials::PasswordCredential>(args, 2);
                auto param3 = py::convert_to<winrt::hstring>(args, 3);

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.ConnectAsync(param0, param1, param2, param3);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* WiFiAdapter_ConnectWithPasswordCredentialAsync(py::wrapper::Windows::Devices::WiFi::WiFiAdapter* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 3)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.WiFi.WiFiAdapter", L"ConnectAsync", 3);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(3);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Devices::WiFi::WiFiAvailableNetwork>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Devices::WiFi::WiFiReconnectionKind>(args, 1);
                auto param2 = py::convert_to<winrt::Windows::Security::Credentials::PasswordCredential>(args, 2);

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.ConnectAsync(param0, param1, param2);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* WiFiAdapter_Disconnect(py::wrapper::Windows::Devices::WiFi::WiFiAdapter* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 0)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.WiFi.WiFiAdapter", L"Disconnect", 0);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                {
                    auto _gil = release_gil();
                    self->obj.Disconnect();
                }

                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* WiFiAdapter_FindAllAdaptersAsync(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 0)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.WiFi.WiFiAdapter", L"FindAllAdaptersAsync", 0);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return winrt::Windows::Devices::WiFi::WiFiAdapter::FindAllAdaptersAsync();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* WiFiAdapter_FromIdAsync(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 1)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.WiFi.WiFiAdapter", L"FromIdAsync", 1);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

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

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return winrt::Windows::Devices::WiFi::WiFiAdapter::FromIdAsync(param0);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* WiFiAdapter_GetDeviceSelector(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 0)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.WiFi.WiFiAdapter", L"GetDeviceSelector", 0);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return winrt::Windows::Devices::WiFi::WiFiAdapter::GetDeviceSelector();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* WiFiAdapter_GetWpsConfigurationAsync(py::wrapper::Windows::Devices::WiFi::WiFiAdapter* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 1)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.WiFi.WiFiAdapter", L"GetWpsConfigurationAsync", 1);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Devices::WiFi::WiFiAvailableNetwork>(args, 0);

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.GetWpsConfigurationAsync(param0);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* WiFiAdapter_RequestAccessAsync(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 0)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.WiFi.WiFiAdapter", L"RequestAccessAsync", 0);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return winrt::Windows::Devices::WiFi::WiFiAdapter::RequestAccessAsync();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* WiFiAdapter_ScanAsync(py::wrapper::Windows::Devices::WiFi::WiFiAdapter* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 0)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.WiFi.WiFiAdapter", L"ScanAsync", 0);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.ScanAsync();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* WiFiAdapter_get_NetworkAdapter(py::wrapper::Windows::Devices::WiFi::WiFiAdapter* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiAdapter", L"NetworkAdapter");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.NetworkAdapter();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* WiFiAdapter_get_NetworkReport(py::wrapper::Windows::Devices::WiFi::WiFiAdapter* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiAdapter", L"NetworkReport");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.NetworkReport();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* WiFiAdapter_add_AvailableNetworksChanged(py::wrapper::Windows::Devices::WiFi::WiFiAdapter* self, PyObject* arg) noexcept
    {
        try
        {
            static std::optional<bool> is_event_present{};

            if (!is_event_present.has_value())
            {
                is_event_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Devices.WiFi.WiFiAdapter", L"AvailableNetworksChanged");
            }

            if (!is_event_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
                return nullptr;
            }

            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Devices::WiFi::WiFiAdapter, winrt::Windows::Foundation::IInspectable>>(arg);

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.AvailableNetworksChanged(param0);
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* WiFiAdapter_remove_AvailableNetworksChanged(py::wrapper::Windows::Devices::WiFi::WiFiAdapter* self, PyObject* arg) noexcept
    {
        try
        {
            static std::optional<bool> is_event_present{};

            if (!is_event_present.has_value())
            {
                is_event_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Devices.WiFi.WiFiAdapter", L"AvailableNetworksChanged");
            }

            if (!is_event_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
                return nullptr;
            }

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

            {
                auto _gil = release_gil();
                self->obj.AvailableNetworksChanged(param0);
            }

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

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

    static PyObject* _from_WiFiAdapter(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::Devices::WiFi::WiFiAdapter>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_WiFiAdapter[] = {
        { "connect_async", reinterpret_cast<PyCFunction>(WiFiAdapter_ConnectAsync), METH_VARARGS, nullptr },
        { "connect_with_password_credential_and_ssid_and_connection_method_async", reinterpret_cast<PyCFunction>(WiFiAdapter_ConnectWithPasswordCredentialAndSsidAndConnectionMethodAsync), METH_VARARGS, nullptr },
        { "connect_with_password_credential_and_ssid_async", reinterpret_cast<PyCFunction>(WiFiAdapter_ConnectWithPasswordCredentialAndSsidAsync), METH_VARARGS, nullptr },
        { "connect_with_password_credential_async", reinterpret_cast<PyCFunction>(WiFiAdapter_ConnectWithPasswordCredentialAsync), METH_VARARGS, nullptr },
        { "disconnect", reinterpret_cast<PyCFunction>(WiFiAdapter_Disconnect), METH_VARARGS, nullptr },
        { "get_wps_configuration_async", reinterpret_cast<PyCFunction>(WiFiAdapter_GetWpsConfigurationAsync), METH_VARARGS, nullptr },
        { "scan_async", reinterpret_cast<PyCFunction>(WiFiAdapter_ScanAsync), METH_VARARGS, nullptr },
        { "add_available_networks_changed", reinterpret_cast<PyCFunction>(WiFiAdapter_add_AvailableNetworksChanged), METH_O, nullptr },
        { "remove_available_networks_changed", reinterpret_cast<PyCFunction>(WiFiAdapter_remove_AvailableNetworksChanged), METH_O, nullptr },
        { "_assign_array_", _assign_array_WiFiAdapter, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_WiFiAdapter), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_WiFiAdapter[] = {
        { "network_adapter", reinterpret_cast<getter>(WiFiAdapter_get_NetworkAdapter), nullptr, nullptr, nullptr },
        { "network_report", reinterpret_cast<getter>(WiFiAdapter_get_NetworkReport), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_WiFiAdapter[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_WiFiAdapter) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_WiFiAdapter) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_WiFiAdapter) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_WiFiAdapter) },
        { }};

    static PyType_Spec type_spec_WiFiAdapter = {
        "winrt._winrt_windows_devices_wifi.WiFiAdapter",
        sizeof(py::wrapper::Windows::Devices::WiFi::WiFiAdapter),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_WiFiAdapter};

    static PyGetSetDef getset_WiFiAdapter_Static[] = {
        { }};

    static PyMethodDef methods_WiFiAdapter_Static[] = {
        { "find_all_adapters_async", reinterpret_cast<PyCFunction>(WiFiAdapter_FindAllAdaptersAsync), METH_VARARGS, nullptr },
        { "from_id_async", reinterpret_cast<PyCFunction>(WiFiAdapter_FromIdAsync), METH_VARARGS, nullptr },
        { "get_device_selector", reinterpret_cast<PyCFunction>(WiFiAdapter_GetDeviceSelector), METH_VARARGS, nullptr },
        { "request_access_async", reinterpret_cast<PyCFunction>(WiFiAdapter_RequestAccessAsync), METH_VARARGS, nullptr },
        { }};

    static PyType_Slot type_slots_WiFiAdapter_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_WiFiAdapter_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_WiFiAdapter_Static) },
        { }
    };

    static PyType_Spec type_spec_WiFiAdapter_Static = {
        "winrt._winrt_windows_devices_wifi.WiFiAdapter_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_WiFiAdapter_Static};

    // ----- WiFiAvailableNetwork class --------------------

    static PyObject* _new_WiFiAvailableNetwork(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Devices::WiFi::WiFiAvailableNetwork>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::WiFi::WiFiAvailableNetwork>::type_name);
        return nullptr;
    }

    static void _dealloc_WiFiAvailableNetwork(py::wrapper::Windows::Devices::WiFi::WiFiAvailableNetwork* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* WiFiAvailableNetwork_get_BeaconInterval(py::wrapper::Windows::Devices::WiFi::WiFiAvailableNetwork* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiAvailableNetwork", L"BeaconInterval");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.BeaconInterval();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* WiFiAvailableNetwork_get_Bssid(py::wrapper::Windows::Devices::WiFi::WiFiAvailableNetwork* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiAvailableNetwork", L"Bssid");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Bssid();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* WiFiAvailableNetwork_get_ChannelCenterFrequencyInKilohertz(py::wrapper::Windows::Devices::WiFi::WiFiAvailableNetwork* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiAvailableNetwork", L"ChannelCenterFrequencyInKilohertz");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.ChannelCenterFrequencyInKilohertz();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* WiFiAvailableNetwork_get_IsWiFiDirect(py::wrapper::Windows::Devices::WiFi::WiFiAvailableNetwork* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiAvailableNetwork", L"IsWiFiDirect");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.IsWiFiDirect();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* WiFiAvailableNetwork_get_NetworkKind(py::wrapper::Windows::Devices::WiFi::WiFiAvailableNetwork* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiAvailableNetwork", L"NetworkKind");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.NetworkKind();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* WiFiAvailableNetwork_get_NetworkRssiInDecibelMilliwatts(py::wrapper::Windows::Devices::WiFi::WiFiAvailableNetwork* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiAvailableNetwork", L"NetworkRssiInDecibelMilliwatts");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.NetworkRssiInDecibelMilliwatts();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* WiFiAvailableNetwork_get_PhyKind(py::wrapper::Windows::Devices::WiFi::WiFiAvailableNetwork* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiAvailableNetwork", L"PhyKind");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.PhyKind();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* WiFiAvailableNetwork_get_SecuritySettings(py::wrapper::Windows::Devices::WiFi::WiFiAvailableNetwork* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiAvailableNetwork", L"SecuritySettings");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.SecuritySettings();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* WiFiAvailableNetwork_get_SignalBars(py::wrapper::Windows::Devices::WiFi::WiFiAvailableNetwork* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiAvailableNetwork", L"SignalBars");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.SignalBars();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* WiFiAvailableNetwork_get_Ssid(py::wrapper::Windows::Devices::WiFi::WiFiAvailableNetwork* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiAvailableNetwork", L"Ssid");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Ssid();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* WiFiAvailableNetwork_get_Uptime(py::wrapper::Windows::Devices::WiFi::WiFiAvailableNetwork* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiAvailableNetwork", L"Uptime");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Uptime();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_WiFiAvailableNetwork(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::Devices::WiFi::WiFiAvailableNetwork>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_WiFiAvailableNetwork[] = {
        { "_assign_array_", _assign_array_WiFiAvailableNetwork, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_WiFiAvailableNetwork), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_WiFiAvailableNetwork[] = {
        { "beacon_interval", reinterpret_cast<getter>(WiFiAvailableNetwork_get_BeaconInterval), nullptr, nullptr, nullptr },
        { "bssid", reinterpret_cast<getter>(WiFiAvailableNetwork_get_Bssid), nullptr, nullptr, nullptr },
        { "channel_center_frequency_in_kilohertz", reinterpret_cast<getter>(WiFiAvailableNetwork_get_ChannelCenterFrequencyInKilohertz), nullptr, nullptr, nullptr },
        { "is_wi_fi_direct", reinterpret_cast<getter>(WiFiAvailableNetwork_get_IsWiFiDirect), nullptr, nullptr, nullptr },
        { "network_kind", reinterpret_cast<getter>(WiFiAvailableNetwork_get_NetworkKind), nullptr, nullptr, nullptr },
        { "network_rssi_in_decibel_milliwatts", reinterpret_cast<getter>(WiFiAvailableNetwork_get_NetworkRssiInDecibelMilliwatts), nullptr, nullptr, nullptr },
        { "phy_kind", reinterpret_cast<getter>(WiFiAvailableNetwork_get_PhyKind), nullptr, nullptr, nullptr },
        { "security_settings", reinterpret_cast<getter>(WiFiAvailableNetwork_get_SecuritySettings), nullptr, nullptr, nullptr },
        { "signal_bars", reinterpret_cast<getter>(WiFiAvailableNetwork_get_SignalBars), nullptr, nullptr, nullptr },
        { "ssid", reinterpret_cast<getter>(WiFiAvailableNetwork_get_Ssid), nullptr, nullptr, nullptr },
        { "uptime", reinterpret_cast<getter>(WiFiAvailableNetwork_get_Uptime), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_WiFiAvailableNetwork[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_WiFiAvailableNetwork) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_WiFiAvailableNetwork) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_WiFiAvailableNetwork) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_WiFiAvailableNetwork) },
        { }};

    static PyType_Spec type_spec_WiFiAvailableNetwork = {
        "winrt._winrt_windows_devices_wifi.WiFiAvailableNetwork",
        sizeof(py::wrapper::Windows::Devices::WiFi::WiFiAvailableNetwork),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_WiFiAvailableNetwork};

    // ----- WiFiConnectionResult class --------------------

    static PyObject* _new_WiFiConnectionResult(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Devices::WiFi::WiFiConnectionResult>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::WiFi::WiFiConnectionResult>::type_name);
        return nullptr;
    }

    static void _dealloc_WiFiConnectionResult(py::wrapper::Windows::Devices::WiFi::WiFiConnectionResult* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* WiFiConnectionResult_get_ConnectionStatus(py::wrapper::Windows::Devices::WiFi::WiFiConnectionResult* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiConnectionResult", L"ConnectionStatus");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.ConnectionStatus();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_WiFiConnectionResult(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::Devices::WiFi::WiFiConnectionResult>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_WiFiConnectionResult[] = {
        { "_assign_array_", _assign_array_WiFiConnectionResult, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_WiFiConnectionResult), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_WiFiConnectionResult[] = {
        { "connection_status", reinterpret_cast<getter>(WiFiConnectionResult_get_ConnectionStatus), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_WiFiConnectionResult[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_WiFiConnectionResult) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_WiFiConnectionResult) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_WiFiConnectionResult) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_WiFiConnectionResult) },
        { }};

    static PyType_Spec type_spec_WiFiConnectionResult = {
        "winrt._winrt_windows_devices_wifi.WiFiConnectionResult",
        sizeof(py::wrapper::Windows::Devices::WiFi::WiFiConnectionResult),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_WiFiConnectionResult};

    // ----- WiFiNetworkReport class --------------------

    static PyObject* _new_WiFiNetworkReport(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Devices::WiFi::WiFiNetworkReport>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::WiFi::WiFiNetworkReport>::type_name);
        return nullptr;
    }

    static void _dealloc_WiFiNetworkReport(py::wrapper::Windows::Devices::WiFi::WiFiNetworkReport* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* WiFiNetworkReport_get_AvailableNetworks(py::wrapper::Windows::Devices::WiFi::WiFiNetworkReport* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiNetworkReport", L"AvailableNetworks");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.AvailableNetworks();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* WiFiNetworkReport_get_Timestamp(py::wrapper::Windows::Devices::WiFi::WiFiNetworkReport* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiNetworkReport", L"Timestamp");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Timestamp();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_WiFiNetworkReport(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::Devices::WiFi::WiFiNetworkReport>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_WiFiNetworkReport[] = {
        { "_assign_array_", _assign_array_WiFiNetworkReport, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_WiFiNetworkReport), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_WiFiNetworkReport[] = {
        { "available_networks", reinterpret_cast<getter>(WiFiNetworkReport_get_AvailableNetworks), nullptr, nullptr, nullptr },
        { "timestamp", reinterpret_cast<getter>(WiFiNetworkReport_get_Timestamp), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_WiFiNetworkReport[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_WiFiNetworkReport) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_WiFiNetworkReport) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_WiFiNetworkReport) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_WiFiNetworkReport) },
        { }};

    static PyType_Spec type_spec_WiFiNetworkReport = {
        "winrt._winrt_windows_devices_wifi.WiFiNetworkReport",
        sizeof(py::wrapper::Windows::Devices::WiFi::WiFiNetworkReport),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_WiFiNetworkReport};

    // ----- WiFiOnDemandHotspotConnectTriggerDetails class --------------------

    static PyObject* _new_WiFiOnDemandHotspotConnectTriggerDetails(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Devices::WiFi::WiFiOnDemandHotspotConnectTriggerDetails>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::WiFi::WiFiOnDemandHotspotConnectTriggerDetails>::type_name);
        return nullptr;
    }

    static void _dealloc_WiFiOnDemandHotspotConnectTriggerDetails(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotConnectTriggerDetails* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* WiFiOnDemandHotspotConnectTriggerDetails_Connect(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotConnectTriggerDetails* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 0)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotConnectTriggerDetails", L"Connect", 0);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.Connect();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* WiFiOnDemandHotspotConnectTriggerDetails_ConnectAsync(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotConnectTriggerDetails* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 0)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotConnectTriggerDetails", L"ConnectAsync", 0);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.ConnectAsync();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* WiFiOnDemandHotspotConnectTriggerDetails_ReportError(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotConnectTriggerDetails* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 1)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotConnectTriggerDetails", L"ReportError", 1);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Devices::WiFi::WiFiOnDemandHotspotConnectStatus>(args, 0);

                {
                    auto _gil = release_gil();
                    self->obj.ReportError(param0);
                }

                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* WiFiOnDemandHotspotConnectTriggerDetails_get_RequestedNetwork(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotConnectTriggerDetails* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotConnectTriggerDetails", L"RequestedNetwork");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.RequestedNetwork();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_WiFiOnDemandHotspotConnectTriggerDetails(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::Devices::WiFi::WiFiOnDemandHotspotConnectTriggerDetails>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_WiFiOnDemandHotspotConnectTriggerDetails[] = {
        { "connect", reinterpret_cast<PyCFunction>(WiFiOnDemandHotspotConnectTriggerDetails_Connect), METH_VARARGS, nullptr },
        { "connect_async", reinterpret_cast<PyCFunction>(WiFiOnDemandHotspotConnectTriggerDetails_ConnectAsync), METH_VARARGS, nullptr },
        { "report_error", reinterpret_cast<PyCFunction>(WiFiOnDemandHotspotConnectTriggerDetails_ReportError), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_WiFiOnDemandHotspotConnectTriggerDetails, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_WiFiOnDemandHotspotConnectTriggerDetails), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_WiFiOnDemandHotspotConnectTriggerDetails[] = {
        { "requested_network", reinterpret_cast<getter>(WiFiOnDemandHotspotConnectTriggerDetails_get_RequestedNetwork), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_WiFiOnDemandHotspotConnectTriggerDetails[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_WiFiOnDemandHotspotConnectTriggerDetails) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_WiFiOnDemandHotspotConnectTriggerDetails) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_WiFiOnDemandHotspotConnectTriggerDetails) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_WiFiOnDemandHotspotConnectTriggerDetails) },
        { }};

    static PyType_Spec type_spec_WiFiOnDemandHotspotConnectTriggerDetails = {
        "winrt._winrt_windows_devices_wifi.WiFiOnDemandHotspotConnectTriggerDetails",
        sizeof(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotConnectTriggerDetails),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_WiFiOnDemandHotspotConnectTriggerDetails};

    // ----- WiFiOnDemandHotspotConnectionResult class --------------------

    static PyObject* _new_WiFiOnDemandHotspotConnectionResult(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Devices::WiFi::WiFiOnDemandHotspotConnectionResult>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::WiFi::WiFiOnDemandHotspotConnectionResult>::type_name);
        return nullptr;
    }

    static void _dealloc_WiFiOnDemandHotspotConnectionResult(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotConnectionResult* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* WiFiOnDemandHotspotConnectionResult_get_Status(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotConnectionResult* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotConnectionResult", L"Status");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Status();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_WiFiOnDemandHotspotConnectionResult(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::Devices::WiFi::WiFiOnDemandHotspotConnectionResult>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_WiFiOnDemandHotspotConnectionResult[] = {
        { "_assign_array_", _assign_array_WiFiOnDemandHotspotConnectionResult, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_WiFiOnDemandHotspotConnectionResult), METH_O | METH_STATIC, nullptr },
        { }};

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

    static PyType_Slot _type_slots_WiFiOnDemandHotspotConnectionResult[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_WiFiOnDemandHotspotConnectionResult) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_WiFiOnDemandHotspotConnectionResult) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_WiFiOnDemandHotspotConnectionResult) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_WiFiOnDemandHotspotConnectionResult) },
        { }};

    static PyType_Spec type_spec_WiFiOnDemandHotspotConnectionResult = {
        "winrt._winrt_windows_devices_wifi.WiFiOnDemandHotspotConnectionResult",
        sizeof(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotConnectionResult),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_WiFiOnDemandHotspotConnectionResult};

    // ----- WiFiOnDemandHotspotNetwork class --------------------

    static PyObject* _new_WiFiOnDemandHotspotNetwork(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Devices::WiFi::WiFiOnDemandHotspotNetwork>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::WiFi::WiFiOnDemandHotspotNetwork>::type_name);
        return nullptr;
    }

    static void _dealloc_WiFiOnDemandHotspotNetwork(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetwork* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* WiFiOnDemandHotspotNetwork_GetOrCreateById(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 1)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotNetwork", L"GetOrCreateById", 1);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::guid>(args, 0);

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return winrt::Windows::Devices::WiFi::WiFiOnDemandHotspotNetwork::GetOrCreateById(param0);
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* WiFiOnDemandHotspotNetwork_GetProperties(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetwork* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 0)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotNetwork", L"GetProperties", 0);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(0);
                    return nullptr;
                }

                return py::convert([&]()
                {
                    auto _gil = release_gil();
                    return self->obj.GetProperties();
                }());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* WiFiOnDemandHotspotNetwork_UpdateProperties(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetwork* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_GET_SIZE(args);

        if (arg_count == 1)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotNetwork", L"UpdateProperties", 1);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties>(args, 0);

                {
                    auto _gil = release_gil();
                    self->obj.UpdateProperties(param0);
                }

                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* WiFiOnDemandHotspotNetwork_get_Id(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetwork* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotNetwork", L"Id");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Id();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_WiFiOnDemandHotspotNetwork(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::Devices::WiFi::WiFiOnDemandHotspotNetwork>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_WiFiOnDemandHotspotNetwork[] = {
        { "get_properties", reinterpret_cast<PyCFunction>(WiFiOnDemandHotspotNetwork_GetProperties), METH_VARARGS, nullptr },
        { "update_properties", reinterpret_cast<PyCFunction>(WiFiOnDemandHotspotNetwork_UpdateProperties), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_WiFiOnDemandHotspotNetwork, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_WiFiOnDemandHotspotNetwork), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_WiFiOnDemandHotspotNetwork[] = {
        { "id", reinterpret_cast<getter>(WiFiOnDemandHotspotNetwork_get_Id), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_WiFiOnDemandHotspotNetwork[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_WiFiOnDemandHotspotNetwork) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_WiFiOnDemandHotspotNetwork) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_WiFiOnDemandHotspotNetwork) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_WiFiOnDemandHotspotNetwork) },
        { }};

    static PyType_Spec type_spec_WiFiOnDemandHotspotNetwork = {
        "winrt._winrt_windows_devices_wifi.WiFiOnDemandHotspotNetwork",
        sizeof(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetwork),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_WiFiOnDemandHotspotNetwork};

    static PyGetSetDef getset_WiFiOnDemandHotspotNetwork_Static[] = {
        { }};

    static PyMethodDef methods_WiFiOnDemandHotspotNetwork_Static[] = {
        { "get_or_create_by_id", reinterpret_cast<PyCFunction>(WiFiOnDemandHotspotNetwork_GetOrCreateById), METH_VARARGS, nullptr },
        { }};

    static PyType_Slot type_slots_WiFiOnDemandHotspotNetwork_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_WiFiOnDemandHotspotNetwork_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_WiFiOnDemandHotspotNetwork_Static) },
        { }
    };

    static PyType_Spec type_spec_WiFiOnDemandHotspotNetwork_Static = {
        "winrt._winrt_windows_devices_wifi.WiFiOnDemandHotspotNetwork_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_WiFiOnDemandHotspotNetwork_Static};

    // ----- WiFiOnDemandHotspotNetworkProperties class --------------------

    static PyObject* _new_WiFiOnDemandHotspotNetworkProperties(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties>::type_name);
        return nullptr;
    }

    static void _dealloc_WiFiOnDemandHotspotNetworkProperties(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* WiFiOnDemandHotspotNetworkProperties_get_Ssid(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotNetworkProperties", L"Ssid");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Ssid();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int WiFiOnDemandHotspotNetworkProperties_put_Ssid(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotNetworkProperties", L"Ssid");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::hstring>(arg);

            {
                auto _gil = release_gil();
                self->obj.Ssid(param0);
            }

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

    static PyObject* WiFiOnDemandHotspotNetworkProperties_get_RemainingBatteryPercent(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotNetworkProperties", L"RemainingBatteryPercent");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.RemainingBatteryPercent();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int WiFiOnDemandHotspotNetworkProperties_put_RemainingBatteryPercent(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotNetworkProperties", L"RemainingBatteryPercent");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Foundation::IReference<uint32_t>>(arg);

            {
                auto _gil = release_gil();
                self->obj.RemainingBatteryPercent(param0);
            }

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

    static PyObject* WiFiOnDemandHotspotNetworkProperties_get_Password(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotNetworkProperties", L"Password");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Password();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int WiFiOnDemandHotspotNetworkProperties_put_Password(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotNetworkProperties", L"Password");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Security::Credentials::PasswordCredential>(arg);

            {
                auto _gil = release_gil();
                self->obj.Password(param0);
            }

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

    static PyObject* WiFiOnDemandHotspotNetworkProperties_get_IsMetered(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotNetworkProperties", L"IsMetered");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.IsMetered();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int WiFiOnDemandHotspotNetworkProperties_put_IsMetered(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotNetworkProperties", L"IsMetered");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

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

            {
                auto _gil = release_gil();
                self->obj.IsMetered(param0);
            }

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

    static PyObject* WiFiOnDemandHotspotNetworkProperties_get_DisplayName(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotNetworkProperties", L"DisplayName");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.DisplayName();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int WiFiOnDemandHotspotNetworkProperties_put_DisplayName(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotNetworkProperties", L"DisplayName");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::hstring>(arg);

            {
                auto _gil = release_gil();
                self->obj.DisplayName(param0);
            }

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

    static PyObject* WiFiOnDemandHotspotNetworkProperties_get_CellularBars(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotNetworkProperties", L"CellularBars");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.CellularBars();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int WiFiOnDemandHotspotNetworkProperties_put_CellularBars(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotNetworkProperties", L"CellularBars");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Foundation::IReference<winrt::Windows::Devices::WiFi::WiFiOnDemandHotspotCellularBars>>(arg);

            {
                auto _gil = release_gil();
                self->obj.CellularBars(param0);
            }

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

    static PyObject* WiFiOnDemandHotspotNetworkProperties_get_Availability(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotNetworkProperties", L"Availability");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Availability();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int WiFiOnDemandHotspotNetworkProperties_put_Availability(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!arg)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiOnDemandHotspotNetworkProperties", L"Availability");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Devices::WiFi::WiFiOnDemandHotspotAvailability>(arg);

            {
                auto _gil = release_gil();
                self->obj.Availability(param0);
            }

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

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

    static PyObject* _from_WiFiOnDemandHotspotNetworkProperties(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::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_WiFiOnDemandHotspotNetworkProperties[] = {
        { "_assign_array_", _assign_array_WiFiOnDemandHotspotNetworkProperties, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_WiFiOnDemandHotspotNetworkProperties), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_WiFiOnDemandHotspotNetworkProperties[] = {
        { "ssid", reinterpret_cast<getter>(WiFiOnDemandHotspotNetworkProperties_get_Ssid), reinterpret_cast<setter>(WiFiOnDemandHotspotNetworkProperties_put_Ssid), nullptr, nullptr },
        { "remaining_battery_percent", reinterpret_cast<getter>(WiFiOnDemandHotspotNetworkProperties_get_RemainingBatteryPercent), reinterpret_cast<setter>(WiFiOnDemandHotspotNetworkProperties_put_RemainingBatteryPercent), nullptr, nullptr },
        { "password", reinterpret_cast<getter>(WiFiOnDemandHotspotNetworkProperties_get_Password), reinterpret_cast<setter>(WiFiOnDemandHotspotNetworkProperties_put_Password), nullptr, nullptr },
        { "is_metered", reinterpret_cast<getter>(WiFiOnDemandHotspotNetworkProperties_get_IsMetered), reinterpret_cast<setter>(WiFiOnDemandHotspotNetworkProperties_put_IsMetered), nullptr, nullptr },
        { "display_name", reinterpret_cast<getter>(WiFiOnDemandHotspotNetworkProperties_get_DisplayName), reinterpret_cast<setter>(WiFiOnDemandHotspotNetworkProperties_put_DisplayName), nullptr, nullptr },
        { "cellular_bars", reinterpret_cast<getter>(WiFiOnDemandHotspotNetworkProperties_get_CellularBars), reinterpret_cast<setter>(WiFiOnDemandHotspotNetworkProperties_put_CellularBars), nullptr, nullptr },
        { "availability", reinterpret_cast<getter>(WiFiOnDemandHotspotNetworkProperties_get_Availability), reinterpret_cast<setter>(WiFiOnDemandHotspotNetworkProperties_put_Availability), nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_WiFiOnDemandHotspotNetworkProperties[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_WiFiOnDemandHotspotNetworkProperties) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_WiFiOnDemandHotspotNetworkProperties) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_WiFiOnDemandHotspotNetworkProperties) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_WiFiOnDemandHotspotNetworkProperties) },
        { }};

    static PyType_Spec type_spec_WiFiOnDemandHotspotNetworkProperties = {
        "winrt._winrt_windows_devices_wifi.WiFiOnDemandHotspotNetworkProperties",
        sizeof(py::wrapper::Windows::Devices::WiFi::WiFiOnDemandHotspotNetworkProperties),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_WiFiOnDemandHotspotNetworkProperties};

    // ----- WiFiWpsConfigurationResult class --------------------

    static PyObject* _new_WiFiWpsConfigurationResult(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Devices::WiFi::WiFiWpsConfigurationResult>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Devices::WiFi::WiFiWpsConfigurationResult>::type_name);
        return nullptr;
    }

    static void _dealloc_WiFiWpsConfigurationResult(py::wrapper::Windows::Devices::WiFi::WiFiWpsConfigurationResult* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* WiFiWpsConfigurationResult_get_Status(py::wrapper::Windows::Devices::WiFi::WiFiWpsConfigurationResult* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiWpsConfigurationResult", L"Status");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.Status();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* WiFiWpsConfigurationResult_get_SupportedWpsKinds(py::wrapper::Windows::Devices::WiFi::WiFiWpsConfigurationResult* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Devices.WiFi.WiFiWpsConfigurationResult", L"SupportedWpsKinds");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert([&]()
            {
                auto _gil = release_gil();
                return self->obj.SupportedWpsKinds();
            }());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyObject* _from_WiFiWpsConfigurationResult(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::Devices::WiFi::WiFiWpsConfigurationResult>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_WiFiWpsConfigurationResult[] = {
        { "_assign_array_", _assign_array_WiFiWpsConfigurationResult, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_WiFiWpsConfigurationResult), METH_O | METH_STATIC, nullptr },
        { }};

    static PyGetSetDef _getset_WiFiWpsConfigurationResult[] = {
        { "status", reinterpret_cast<getter>(WiFiWpsConfigurationResult_get_Status), nullptr, nullptr, nullptr },
        { "supported_wps_kinds", reinterpret_cast<getter>(WiFiWpsConfigurationResult_get_SupportedWpsKinds), nullptr, nullptr, nullptr },
        { }};

    static PyType_Slot _type_slots_WiFiWpsConfigurationResult[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_WiFiWpsConfigurationResult) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_WiFiWpsConfigurationResult) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_WiFiWpsConfigurationResult) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_WiFiWpsConfigurationResult) },
        { }};

    static PyType_Spec type_spec_WiFiWpsConfigurationResult = {
        "winrt._winrt_windows_devices_wifi.WiFiWpsConfigurationResult",
        sizeof(py::wrapper::Windows::Devices::WiFi::WiFiWpsConfigurationResult),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_WiFiWpsConfigurationResult};

    // ----- Windows.Devices.WiFi Initialization --------------------

    PyDoc_STRVAR(module_doc, "Windows.Devices.WiFi");

    static PyModuleDef module_def = {
        PyModuleDef_HEAD_INIT,
        "_winrt_windows_devices_wifi",
        module_doc,
        0,
        nullptr,
        nullptr,
        nullptr,
        nullptr,
        nullptr};
} // py::cpp::Windows::Devices::WiFi

PyMODINIT_FUNC PyInit__winrt_windows_devices_wifi(void) noexcept
{
    using namespace py::cpp::Windows::Devices::WiFi;

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

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

    if (!module)
    {
        return nullptr;
    }

    auto inspectable_meta_type = py::get_inspectable_meta_type();
    if (!inspectable_meta_type)
    {
        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 WiFiAdapter_Static_bases{PyTuple_Pack(1, reinterpret_cast<PyObject*>(inspectable_meta_type))};
    if (!WiFiAdapter_Static_bases)
    {
        return nullptr;
    }

    py::pyobj_handle type_WiFiAdapter_Static{PyType_FromSpecWithBases(&type_spec_WiFiAdapter_Static, WiFiAdapter_Static_bases.get())};
    if (!type_WiFiAdapter_Static)
    {
        return nullptr;
    }

    py::pytype_handle WiFiAdapter_type{py::register_python_type(module.get(), &type_spec_WiFiAdapter, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_WiFiAdapter_Static.get()))};
    if (!WiFiAdapter_type)
    {
        return nullptr;
    }

    py::pytype_handle WiFiAvailableNetwork_type{py::register_python_type(module.get(), &type_spec_WiFiAvailableNetwork, object_bases.get(), inspectable_meta_type)};
    if (!WiFiAvailableNetwork_type)
    {
        return nullptr;
    }

    py::pytype_handle WiFiConnectionResult_type{py::register_python_type(module.get(), &type_spec_WiFiConnectionResult, object_bases.get(), inspectable_meta_type)};
    if (!WiFiConnectionResult_type)
    {
        return nullptr;
    }

    py::pytype_handle WiFiNetworkReport_type{py::register_python_type(module.get(), &type_spec_WiFiNetworkReport, object_bases.get(), inspectable_meta_type)};
    if (!WiFiNetworkReport_type)
    {
        return nullptr;
    }

    py::pytype_handle WiFiOnDemandHotspotConnectTriggerDetails_type{py::register_python_type(module.get(), &type_spec_WiFiOnDemandHotspotConnectTriggerDetails, object_bases.get(), inspectable_meta_type)};
    if (!WiFiOnDemandHotspotConnectTriggerDetails_type)
    {
        return nullptr;
    }

    py::pytype_handle WiFiOnDemandHotspotConnectionResult_type{py::register_python_type(module.get(), &type_spec_WiFiOnDemandHotspotConnectionResult, object_bases.get(), inspectable_meta_type)};
    if (!WiFiOnDemandHotspotConnectionResult_type)
    {
        return nullptr;
    }

    py::pyobj_handle WiFiOnDemandHotspotNetwork_Static_bases{PyTuple_Pack(1, reinterpret_cast<PyObject*>(inspectable_meta_type))};
    if (!WiFiOnDemandHotspotNetwork_Static_bases)
    {
        return nullptr;
    }

    py::pyobj_handle type_WiFiOnDemandHotspotNetwork_Static{PyType_FromSpecWithBases(&type_spec_WiFiOnDemandHotspotNetwork_Static, WiFiOnDemandHotspotNetwork_Static_bases.get())};
    if (!type_WiFiOnDemandHotspotNetwork_Static)
    {
        return nullptr;
    }

    py::pytype_handle WiFiOnDemandHotspotNetwork_type{py::register_python_type(module.get(), &type_spec_WiFiOnDemandHotspotNetwork, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_WiFiOnDemandHotspotNetwork_Static.get()))};
    if (!WiFiOnDemandHotspotNetwork_type)
    {
        return nullptr;
    }

    py::pytype_handle WiFiOnDemandHotspotNetworkProperties_type{py::register_python_type(module.get(), &type_spec_WiFiOnDemandHotspotNetworkProperties, object_bases.get(), inspectable_meta_type)};
    if (!WiFiOnDemandHotspotNetworkProperties_type)
    {
        return nullptr;
    }

    py::pytype_handle WiFiWpsConfigurationResult_type{py::register_python_type(module.get(), &type_spec_WiFiWpsConfigurationResult, object_bases.get(), inspectable_meta_type)};
    if (!WiFiWpsConfigurationResult_type)
    {
        return nullptr;
    }


    return module.detach();
}
