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

#include "pybase.h"
#include "py.Windows.System.UserProfile.h"

PyTypeObject* py::winrt_type<winrt::Windows::System::UserProfile::AdvertisingManager>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::System::UserProfile::AdvertisingManagerForUser>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::System::UserProfile::AssignedAccessSettings>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::System::UserProfile::DiagnosticsSettings>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::System::UserProfile::FirstSignInSettings>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::System::UserProfile::GlobalizationPreferences>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::System::UserProfile::GlobalizationPreferencesForUser>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::System::UserProfile::UserProfilePersonalizationSettings>::python_type;

namespace py::cpp::Windows::System::UserProfile
{
    // ----- AdvertisingManager class --------------------
    constexpr const char* const _type_name_AdvertisingManager = "AdvertisingManager";

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

    static PyObject* AdvertisingManager_GetForUser(PyObject* /*unused*/, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

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

                return py::convert(winrt::Windows::System::UserProfile::AdvertisingManager::GetForUser(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* AdvertisingManager_get_AdvertisingId(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::Windows::System::UserProfile::AdvertisingManager::AdvertisingId());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_AdvertisingManager[] = {
        { "get_for_user", reinterpret_cast<PyCFunction>(AdvertisingManager_GetForUser), METH_VARARGS | METH_STATIC, nullptr },
        { "get_advertising_id", reinterpret_cast<PyCFunction>(AdvertisingManager_get_AdvertisingId), METH_NOARGS | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_AdvertisingManager[] = {
        { }
    };

    static PyType_Slot _type_slots_AdvertisingManager[] = 
    {
        { Py_tp_new, _new_AdvertisingManager },
        { Py_tp_methods, _methods_AdvertisingManager },
        { Py_tp_getset, _getset_AdvertisingManager },
        { },
    };

    static PyType_Spec _type_spec_AdvertisingManager =
    {
        "_winsdk_Windows_System_UserProfile.AdvertisingManager",
        0,
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_AdvertisingManager
    };

    // ----- AdvertisingManagerForUser class --------------------
    constexpr const char* const _type_name_AdvertisingManagerForUser = "AdvertisingManagerForUser";

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

    static void _dealloc_AdvertisingManagerForUser(py::wrapper::Windows::System::UserProfile::AdvertisingManagerForUser* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* AdvertisingManagerForUser_get_AdvertisingId(py::wrapper::Windows::System::UserProfile::AdvertisingManagerForUser* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.AdvertisingId());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* AdvertisingManagerForUser_get_User(py::wrapper::Windows::System::UserProfile::AdvertisingManagerForUser* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.User());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_AdvertisingManagerForUser(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::System::UserProfile::AdvertisingManagerForUser>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_AdvertisingManagerForUser[] = {
        { "_from", reinterpret_cast<PyCFunction>(_from_AdvertisingManagerForUser), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_AdvertisingManagerForUser[] = {
        { "advertising_id", reinterpret_cast<getter>(AdvertisingManagerForUser_get_AdvertisingId), nullptr, nullptr, nullptr },
        { "user", reinterpret_cast<getter>(AdvertisingManagerForUser_get_User), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_AdvertisingManagerForUser[] = 
    {
        { Py_tp_new, _new_AdvertisingManagerForUser },
        { Py_tp_dealloc, _dealloc_AdvertisingManagerForUser },
        { Py_tp_methods, _methods_AdvertisingManagerForUser },
        { Py_tp_getset, _getset_AdvertisingManagerForUser },
        { },
    };

    static PyType_Spec _type_spec_AdvertisingManagerForUser =
    {
        "_winsdk_Windows_System_UserProfile.AdvertisingManagerForUser",
        sizeof(py::wrapper::Windows::System::UserProfile::AdvertisingManagerForUser),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_AdvertisingManagerForUser
    };

    // ----- AssignedAccessSettings class --------------------
    constexpr const char* const _type_name_AssignedAccessSettings = "AssignedAccessSettings";

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

    static void _dealloc_AssignedAccessSettings(py::wrapper::Windows::System::UserProfile::AssignedAccessSettings* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* AssignedAccessSettings_GetDefault(PyObject* /*unused*/, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                return py::convert(winrt::Windows::System::UserProfile::AssignedAccessSettings::GetDefault());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* AssignedAccessSettings_GetForUser(PyObject* /*unused*/, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

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

                return py::convert(winrt::Windows::System::UserProfile::AssignedAccessSettings::GetForUser(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* AssignedAccessSettings_get_IsEnabled(py::wrapper::Windows::System::UserProfile::AssignedAccessSettings* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.IsEnabled());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* AssignedAccessSettings_get_IsSingleAppKioskMode(py::wrapper::Windows::System::UserProfile::AssignedAccessSettings* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.IsSingleAppKioskMode());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* AssignedAccessSettings_get_User(py::wrapper::Windows::System::UserProfile::AssignedAccessSettings* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.User());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_AssignedAccessSettings(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::System::UserProfile::AssignedAccessSettings>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_AssignedAccessSettings[] = {
        { "get_default", reinterpret_cast<PyCFunction>(AssignedAccessSettings_GetDefault), METH_VARARGS | METH_STATIC, nullptr },
        { "get_for_user", reinterpret_cast<PyCFunction>(AssignedAccessSettings_GetForUser), METH_VARARGS | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_AssignedAccessSettings), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_AssignedAccessSettings[] = {
        { "is_enabled", reinterpret_cast<getter>(AssignedAccessSettings_get_IsEnabled), nullptr, nullptr, nullptr },
        { "is_single_app_kiosk_mode", reinterpret_cast<getter>(AssignedAccessSettings_get_IsSingleAppKioskMode), nullptr, nullptr, nullptr },
        { "user", reinterpret_cast<getter>(AssignedAccessSettings_get_User), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_AssignedAccessSettings[] = 
    {
        { Py_tp_new, _new_AssignedAccessSettings },
        { Py_tp_dealloc, _dealloc_AssignedAccessSettings },
        { Py_tp_methods, _methods_AssignedAccessSettings },
        { Py_tp_getset, _getset_AssignedAccessSettings },
        { },
    };

    static PyType_Spec _type_spec_AssignedAccessSettings =
    {
        "_winsdk_Windows_System_UserProfile.AssignedAccessSettings",
        sizeof(py::wrapper::Windows::System::UserProfile::AssignedAccessSettings),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_AssignedAccessSettings
    };

    // ----- DiagnosticsSettings class --------------------
    constexpr const char* const _type_name_DiagnosticsSettings = "DiagnosticsSettings";

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

    static void _dealloc_DiagnosticsSettings(py::wrapper::Windows::System::UserProfile::DiagnosticsSettings* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* DiagnosticsSettings_GetDefault(PyObject* /*unused*/, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                return py::convert(winrt::Windows::System::UserProfile::DiagnosticsSettings::GetDefault());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DiagnosticsSettings_GetForUser(PyObject* /*unused*/, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

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

                return py::convert(winrt::Windows::System::UserProfile::DiagnosticsSettings::GetForUser(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* DiagnosticsSettings_get_CanUseDiagnosticsToTailorExperiences(py::wrapper::Windows::System::UserProfile::DiagnosticsSettings* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.CanUseDiagnosticsToTailorExperiences());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* DiagnosticsSettings_get_User(py::wrapper::Windows::System::UserProfile::DiagnosticsSettings* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.User());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_DiagnosticsSettings(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::System::UserProfile::DiagnosticsSettings>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_DiagnosticsSettings[] = {
        { "get_default", reinterpret_cast<PyCFunction>(DiagnosticsSettings_GetDefault), METH_VARARGS | METH_STATIC, nullptr },
        { "get_for_user", reinterpret_cast<PyCFunction>(DiagnosticsSettings_GetForUser), METH_VARARGS | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_DiagnosticsSettings), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_DiagnosticsSettings[] = {
        { "can_use_diagnostics_to_tailor_experiences", reinterpret_cast<getter>(DiagnosticsSettings_get_CanUseDiagnosticsToTailorExperiences), nullptr, nullptr, nullptr },
        { "user", reinterpret_cast<getter>(DiagnosticsSettings_get_User), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_DiagnosticsSettings[] = 
    {
        { Py_tp_new, _new_DiagnosticsSettings },
        { Py_tp_dealloc, _dealloc_DiagnosticsSettings },
        { Py_tp_methods, _methods_DiagnosticsSettings },
        { Py_tp_getset, _getset_DiagnosticsSettings },
        { },
    };

    static PyType_Spec _type_spec_DiagnosticsSettings =
    {
        "_winsdk_Windows_System_UserProfile.DiagnosticsSettings",
        sizeof(py::wrapper::Windows::System::UserProfile::DiagnosticsSettings),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_DiagnosticsSettings
    };

    // ----- FirstSignInSettings class --------------------
    constexpr const char* const _type_name_FirstSignInSettings = "FirstSignInSettings";

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

    static void _dealloc_FirstSignInSettings(py::wrapper::Windows::System::UserProfile::FirstSignInSettings* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* FirstSignInSettings_First(py::wrapper::Windows::System::UserProfile::FirstSignInSettings* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

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

    static PyObject* FirstSignInSettings_GetDefault(PyObject* /*unused*/, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                return py::convert(winrt::Windows::System::UserProfile::FirstSignInSettings::GetDefault());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* FirstSignInSettings_HasKey(py::wrapper::Windows::System::UserProfile::FirstSignInSettings* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

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

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

    static PyObject* FirstSignInSettings_Lookup(py::wrapper::Windows::System::UserProfile::FirstSignInSettings* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

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

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

    static PyObject* FirstSignInSettings_Split(py::wrapper::Windows::System::UserProfile::FirstSignInSettings* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                winrt::Windows::Foundation::Collections::IMapView<winrt::hstring, winrt::Windows::Foundation::IInspectable> param0 { nullptr };
                winrt::Windows::Foundation::Collections::IMapView<winrt::hstring, winrt::Windows::Foundation::IInspectable> param1 { nullptr };

                self->obj.Split(param0, param1);

                py::pyobj_handle out0{ py::convert(param0) };
                if (!out0)
                {
                    return nullptr;
                }
                py::pyobj_handle out1{ py::convert(param1) };
                if (!out1)
                {
                    return nullptr;
                }
                return PyTuple_Pack(2, out0.get(), out1.get());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* FirstSignInSettings_get_Size(py::wrapper::Windows::System::UserProfile::FirstSignInSettings* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Size());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_FirstSignInSettings(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::System::UserProfile::FirstSignInSettings>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _iterator_FirstSignInSettings(py::wrapper::Windows::System::UserProfile::FirstSignInSettings* self) noexcept
    {
        try
        {
            return py::convert(self->obj.First());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int _map_contains_FirstSignInSettings(py::wrapper::Windows::System::UserProfile::FirstSignInSettings* self, PyObject* key) noexcept
    {
        try
        {
            return static_cast<int>(self->obj.HasKey(py::convert_to<winrt::hstring>(key)));
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static Py_ssize_t _map_length_FirstSignInSettings(py::wrapper::Windows::System::UserProfile::FirstSignInSettings* self) noexcept
    {
        try
        {
            return static_cast<Py_ssize_t>(self->obj.Size());
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* _map_subscript_FirstSignInSettings(py::wrapper::Windows::System::UserProfile::FirstSignInSettings* self, PyObject* key) noexcept
    {
        try
        {
            return py::convert(self->obj.Lookup(py::convert_to<winrt::hstring>(key)));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_FirstSignInSettings[] = {
        { "first", reinterpret_cast<PyCFunction>(FirstSignInSettings_First), METH_VARARGS, nullptr },
        { "get_default", reinterpret_cast<PyCFunction>(FirstSignInSettings_GetDefault), METH_VARARGS | METH_STATIC, nullptr },
        { "has_key", reinterpret_cast<PyCFunction>(FirstSignInSettings_HasKey), METH_VARARGS, nullptr },
        { "lookup", reinterpret_cast<PyCFunction>(FirstSignInSettings_Lookup), METH_VARARGS, nullptr },
        { "split", reinterpret_cast<PyCFunction>(FirstSignInSettings_Split), METH_VARARGS, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_FirstSignInSettings), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_FirstSignInSettings[] = {
        { "size", reinterpret_cast<getter>(FirstSignInSettings_get_Size), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_FirstSignInSettings[] = 
    {
        { Py_tp_new, _new_FirstSignInSettings },
        { Py_tp_dealloc, _dealloc_FirstSignInSettings },
        { Py_tp_methods, _methods_FirstSignInSettings },
        { Py_tp_getset, _getset_FirstSignInSettings },
        { Py_tp_iter, _iterator_FirstSignInSettings },
        { Py_sq_contains, _map_contains_FirstSignInSettings },
        { Py_mp_length, _map_length_FirstSignInSettings },
        { Py_mp_subscript, _map_subscript_FirstSignInSettings },
        { },
    };

    static PyType_Spec _type_spec_FirstSignInSettings =
    {
        "_winsdk_Windows_System_UserProfile.FirstSignInSettings",
        sizeof(py::wrapper::Windows::System::UserProfile::FirstSignInSettings),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_FirstSignInSettings
    };

    // ----- GlobalizationPreferences class --------------------
    constexpr const char* const _type_name_GlobalizationPreferences = "GlobalizationPreferences";

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

    static PyObject* GlobalizationPreferences_GetForUser(PyObject* /*unused*/, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

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

                return py::convert(winrt::Windows::System::UserProfile::GlobalizationPreferences::GetForUser(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* GlobalizationPreferences_TrySetHomeGeographicRegion(PyObject* /*unused*/, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

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

                return py::convert(winrt::Windows::System::UserProfile::GlobalizationPreferences::TrySetHomeGeographicRegion(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* GlobalizationPreferences_TrySetLanguages(PyObject* /*unused*/, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Foundation::Collections::IIterable<winrt::hstring>>(args, 0);

                return py::convert(winrt::Windows::System::UserProfile::GlobalizationPreferences::TrySetLanguages(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* GlobalizationPreferences_get_Calendars(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::Windows::System::UserProfile::GlobalizationPreferences::Calendars());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GlobalizationPreferences_get_Clocks(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::Windows::System::UserProfile::GlobalizationPreferences::Clocks());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GlobalizationPreferences_get_Currencies(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::Windows::System::UserProfile::GlobalizationPreferences::Currencies());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GlobalizationPreferences_get_HomeGeographicRegion(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::Windows::System::UserProfile::GlobalizationPreferences::HomeGeographicRegion());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GlobalizationPreferences_get_Languages(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::Windows::System::UserProfile::GlobalizationPreferences::Languages());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GlobalizationPreferences_get_WeekStartsOn(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::Windows::System::UserProfile::GlobalizationPreferences::WeekStartsOn());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_GlobalizationPreferences[] = {
        { "get_for_user", reinterpret_cast<PyCFunction>(GlobalizationPreferences_GetForUser), METH_VARARGS | METH_STATIC, nullptr },
        { "try_set_home_geographic_region", reinterpret_cast<PyCFunction>(GlobalizationPreferences_TrySetHomeGeographicRegion), METH_VARARGS | METH_STATIC, nullptr },
        { "try_set_languages", reinterpret_cast<PyCFunction>(GlobalizationPreferences_TrySetLanguages), METH_VARARGS | METH_STATIC, nullptr },
        { "get_calendars", reinterpret_cast<PyCFunction>(GlobalizationPreferences_get_Calendars), METH_NOARGS | METH_STATIC, nullptr },
        { "get_clocks", reinterpret_cast<PyCFunction>(GlobalizationPreferences_get_Clocks), METH_NOARGS | METH_STATIC, nullptr },
        { "get_currencies", reinterpret_cast<PyCFunction>(GlobalizationPreferences_get_Currencies), METH_NOARGS | METH_STATIC, nullptr },
        { "get_home_geographic_region", reinterpret_cast<PyCFunction>(GlobalizationPreferences_get_HomeGeographicRegion), METH_NOARGS | METH_STATIC, nullptr },
        { "get_languages", reinterpret_cast<PyCFunction>(GlobalizationPreferences_get_Languages), METH_NOARGS | METH_STATIC, nullptr },
        { "get_week_starts_on", reinterpret_cast<PyCFunction>(GlobalizationPreferences_get_WeekStartsOn), METH_NOARGS | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_GlobalizationPreferences[] = {
        { }
    };

    static PyType_Slot _type_slots_GlobalizationPreferences[] = 
    {
        { Py_tp_new, _new_GlobalizationPreferences },
        { Py_tp_methods, _methods_GlobalizationPreferences },
        { Py_tp_getset, _getset_GlobalizationPreferences },
        { },
    };

    static PyType_Spec _type_spec_GlobalizationPreferences =
    {
        "_winsdk_Windows_System_UserProfile.GlobalizationPreferences",
        0,
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_GlobalizationPreferences
    };

    // ----- GlobalizationPreferencesForUser class --------------------
    constexpr const char* const _type_name_GlobalizationPreferencesForUser = "GlobalizationPreferencesForUser";

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

    static void _dealloc_GlobalizationPreferencesForUser(py::wrapper::Windows::System::UserProfile::GlobalizationPreferencesForUser* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* GlobalizationPreferencesForUser_get_Calendars(py::wrapper::Windows::System::UserProfile::GlobalizationPreferencesForUser* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Calendars());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GlobalizationPreferencesForUser_get_Clocks(py::wrapper::Windows::System::UserProfile::GlobalizationPreferencesForUser* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Clocks());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GlobalizationPreferencesForUser_get_Currencies(py::wrapper::Windows::System::UserProfile::GlobalizationPreferencesForUser* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Currencies());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GlobalizationPreferencesForUser_get_HomeGeographicRegion(py::wrapper::Windows::System::UserProfile::GlobalizationPreferencesForUser* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.HomeGeographicRegion());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GlobalizationPreferencesForUser_get_Languages(py::wrapper::Windows::System::UserProfile::GlobalizationPreferencesForUser* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Languages());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GlobalizationPreferencesForUser_get_User(py::wrapper::Windows::System::UserProfile::GlobalizationPreferencesForUser* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.User());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GlobalizationPreferencesForUser_get_WeekStartsOn(py::wrapper::Windows::System::UserProfile::GlobalizationPreferencesForUser* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.WeekStartsOn());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_GlobalizationPreferencesForUser(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::System::UserProfile::GlobalizationPreferencesForUser>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_GlobalizationPreferencesForUser[] = {
        { "_from", reinterpret_cast<PyCFunction>(_from_GlobalizationPreferencesForUser), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_GlobalizationPreferencesForUser[] = {
        { "calendars", reinterpret_cast<getter>(GlobalizationPreferencesForUser_get_Calendars), nullptr, nullptr, nullptr },
        { "clocks", reinterpret_cast<getter>(GlobalizationPreferencesForUser_get_Clocks), nullptr, nullptr, nullptr },
        { "currencies", reinterpret_cast<getter>(GlobalizationPreferencesForUser_get_Currencies), nullptr, nullptr, nullptr },
        { "home_geographic_region", reinterpret_cast<getter>(GlobalizationPreferencesForUser_get_HomeGeographicRegion), nullptr, nullptr, nullptr },
        { "languages", reinterpret_cast<getter>(GlobalizationPreferencesForUser_get_Languages), nullptr, nullptr, nullptr },
        { "user", reinterpret_cast<getter>(GlobalizationPreferencesForUser_get_User), nullptr, nullptr, nullptr },
        { "week_starts_on", reinterpret_cast<getter>(GlobalizationPreferencesForUser_get_WeekStartsOn), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_GlobalizationPreferencesForUser[] = 
    {
        { Py_tp_new, _new_GlobalizationPreferencesForUser },
        { Py_tp_dealloc, _dealloc_GlobalizationPreferencesForUser },
        { Py_tp_methods, _methods_GlobalizationPreferencesForUser },
        { Py_tp_getset, _getset_GlobalizationPreferencesForUser },
        { },
    };

    static PyType_Spec _type_spec_GlobalizationPreferencesForUser =
    {
        "_winsdk_Windows_System_UserProfile.GlobalizationPreferencesForUser",
        sizeof(py::wrapper::Windows::System::UserProfile::GlobalizationPreferencesForUser),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_GlobalizationPreferencesForUser
    };

    // ----- UserProfilePersonalizationSettings class --------------------
    constexpr const char* const _type_name_UserProfilePersonalizationSettings = "UserProfilePersonalizationSettings";

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

    static void _dealloc_UserProfilePersonalizationSettings(py::wrapper::Windows::System::UserProfile::UserProfilePersonalizationSettings* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* UserProfilePersonalizationSettings_IsSupported(PyObject* /*unused*/, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                return py::convert(winrt::Windows::System::UserProfile::UserProfilePersonalizationSettings::IsSupported());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* UserProfilePersonalizationSettings_TrySetLockScreenImageAsync(py::wrapper::Windows::System::UserProfile::UserProfilePersonalizationSettings* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Storage::StorageFile>(args, 0);

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

    static PyObject* UserProfilePersonalizationSettings_TrySetWallpaperImageAsync(py::wrapper::Windows::System::UserProfile::UserProfilePersonalizationSettings* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Storage::StorageFile>(args, 0);

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

    static PyObject* UserProfilePersonalizationSettings_get_Current(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::Windows::System::UserProfile::UserProfilePersonalizationSettings::Current());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_UserProfilePersonalizationSettings(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::System::UserProfile::UserProfilePersonalizationSettings>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_UserProfilePersonalizationSettings[] = {
        { "is_supported", reinterpret_cast<PyCFunction>(UserProfilePersonalizationSettings_IsSupported), METH_VARARGS | METH_STATIC, nullptr },
        { "try_set_lock_screen_image_async", reinterpret_cast<PyCFunction>(UserProfilePersonalizationSettings_TrySetLockScreenImageAsync), METH_VARARGS, nullptr },
        { "try_set_wallpaper_image_async", reinterpret_cast<PyCFunction>(UserProfilePersonalizationSettings_TrySetWallpaperImageAsync), METH_VARARGS, nullptr },
        { "get_current", reinterpret_cast<PyCFunction>(UserProfilePersonalizationSettings_get_Current), METH_NOARGS | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_UserProfilePersonalizationSettings), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_UserProfilePersonalizationSettings[] = {
        { }
    };

    static PyType_Slot _type_slots_UserProfilePersonalizationSettings[] = 
    {
        { Py_tp_new, _new_UserProfilePersonalizationSettings },
        { Py_tp_dealloc, _dealloc_UserProfilePersonalizationSettings },
        { Py_tp_methods, _methods_UserProfilePersonalizationSettings },
        { Py_tp_getset, _getset_UserProfilePersonalizationSettings },
        { },
    };

    static PyType_Spec _type_spec_UserProfilePersonalizationSettings =
    {
        "_winsdk_Windows_System_UserProfile.UserProfilePersonalizationSettings",
        sizeof(py::wrapper::Windows::System::UserProfile::UserProfilePersonalizationSettings),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_UserProfilePersonalizationSettings
    };

    // ----- Windows.System.UserProfile Initialization --------------------
    static int module_exec(PyObject* module) noexcept
    {
        try
        {
            py::pyobj_handle bases { PyTuple_Pack(1, py::winrt_type<py::Object>::python_type) };

            py::winrt_type<winrt::Windows::System::UserProfile::AdvertisingManager>::python_type = py::register_python_type(module, _type_name_AdvertisingManager, &_type_spec_AdvertisingManager, nullptr);
            py::winrt_type<winrt::Windows::System::UserProfile::AdvertisingManagerForUser>::python_type = py::register_python_type(module, _type_name_AdvertisingManagerForUser, &_type_spec_AdvertisingManagerForUser, bases.get());
            py::winrt_type<winrt::Windows::System::UserProfile::AssignedAccessSettings>::python_type = py::register_python_type(module, _type_name_AssignedAccessSettings, &_type_spec_AssignedAccessSettings, bases.get());
            py::winrt_type<winrt::Windows::System::UserProfile::DiagnosticsSettings>::python_type = py::register_python_type(module, _type_name_DiagnosticsSettings, &_type_spec_DiagnosticsSettings, bases.get());
            py::winrt_type<winrt::Windows::System::UserProfile::FirstSignInSettings>::python_type = py::register_python_type(module, _type_name_FirstSignInSettings, &_type_spec_FirstSignInSettings, bases.get());
            py::winrt_type<winrt::Windows::System::UserProfile::GlobalizationPreferences>::python_type = py::register_python_type(module, _type_name_GlobalizationPreferences, &_type_spec_GlobalizationPreferences, nullptr);
            py::winrt_type<winrt::Windows::System::UserProfile::GlobalizationPreferencesForUser>::python_type = py::register_python_type(module, _type_name_GlobalizationPreferencesForUser, &_type_spec_GlobalizationPreferencesForUser, bases.get());
            py::winrt_type<winrt::Windows::System::UserProfile::UserProfilePersonalizationSettings>::python_type = py::register_python_type(module, _type_name_UserProfilePersonalizationSettings, &_type_spec_UserProfilePersonalizationSettings, bases.get());

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

    static PyModuleDef_Slot module_slots[] = {{Py_mod_exec, module_exec}, {}};

    PyDoc_STRVAR(module_doc, "Windows.System.UserProfile");

    static PyModuleDef module_def
        = {PyModuleDef_HEAD_INIT,
           "_winsdk_Windows_System_UserProfile",
           module_doc,
           0,
           nullptr,
           module_slots,
           nullptr,
           nullptr,
           nullptr};
} // py::cpp::Windows::System::UserProfile

PyMODINIT_FUNC
PyInit__winsdk_Windows_System_UserProfile (void) noexcept
{
    return PyModuleDef_Init(&py::cpp::Windows::System::UserProfile::module_def);
}
