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

#include "pybase.h"
#include "py.Windows.ApplicationModel.UserDataAccounts.Provider.h"


namespace py::cpp::Windows::ApplicationModel::UserDataAccounts::Provider
{
    struct module_state
    {
        PyObject* type_UserDataAccountProviderOperationKind;
        PyObject* type_UserDataAccountProviderPartnerAccountKind;
        PyTypeObject* type_UserDataAccountPartnerAccountInfo;
        PyTypeObject* type_UserDataAccountProviderAddAccountOperation;
        PyTypeObject* type_UserDataAccountProviderResolveErrorsOperation;
        PyTypeObject* type_UserDataAccountProviderSettingsOperation;
        PyTypeObject* type_IUserDataAccountProviderOperation;
    };

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

        if (state->type_UserDataAccountProviderOperationKind)
        {
            PyErr_SetString(PyExc_RuntimeError, "type has already been registered");
            return nullptr;
        }

        if (!PyType_Check(type))
        {
            PyErr_SetString(PyExc_TypeError, "argument is not a type");
            return nullptr;
        }

        state->type_UserDataAccountProviderOperationKind = type;
        Py_INCREF(state->type_UserDataAccountProviderOperationKind);


        Py_RETURN_NONE;
    }

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

        if (state->type_UserDataAccountProviderPartnerAccountKind)
        {
            PyErr_SetString(PyExc_RuntimeError, "type has already been registered");
            return nullptr;
        }

        if (!PyType_Check(type))
        {
            PyErr_SetString(PyExc_TypeError, "argument is not a type");
            return nullptr;
        }

        state->type_UserDataAccountProviderPartnerAccountKind = type;
        Py_INCREF(state->type_UserDataAccountProviderPartnerAccountKind);


        Py_RETURN_NONE;
    }

    // ----- UserDataAccountPartnerAccountInfo class --------------------
    static constexpr const char* const type_name_UserDataAccountPartnerAccountInfo = "UserDataAccountPartnerAccountInfo";

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

    static void _dealloc_UserDataAccountPartnerAccountInfo(py::wrapper::Windows::ApplicationModel::UserDataAccounts::Provider::UserDataAccountPartnerAccountInfo* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

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

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

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

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

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

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

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

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

    static PyMethodDef _methods_UserDataAccountPartnerAccountInfo[] = {
        { "_assign_array_", _assign_array_UserDataAccountPartnerAccountInfo, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_UserDataAccountPartnerAccountInfo), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_UserDataAccountPartnerAccountInfo[] = {
        { "account_kind", reinterpret_cast<getter>(UserDataAccountPartnerAccountInfo_get_AccountKind), nullptr, nullptr, nullptr },
        { "display_name", reinterpret_cast<getter>(UserDataAccountPartnerAccountInfo_get_DisplayName), nullptr, nullptr, nullptr },
        { "priority", reinterpret_cast<getter>(UserDataAccountPartnerAccountInfo_get_Priority), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_UserDataAccountPartnerAccountInfo[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_UserDataAccountPartnerAccountInfo) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_UserDataAccountPartnerAccountInfo) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_UserDataAccountPartnerAccountInfo) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_UserDataAccountPartnerAccountInfo) },
        { },
    };

    static PyType_Spec type_spec_UserDataAccountPartnerAccountInfo =
    {
        "_winsdk_Windows_ApplicationModel_UserDataAccounts_Provider.UserDataAccountPartnerAccountInfo",
        sizeof(py::wrapper::Windows::ApplicationModel::UserDataAccounts::Provider::UserDataAccountPartnerAccountInfo),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_UserDataAccountPartnerAccountInfo
    };

    // ----- UserDataAccountProviderAddAccountOperation class --------------------
    static constexpr const char* const type_name_UserDataAccountProviderAddAccountOperation = "UserDataAccountProviderAddAccountOperation";

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

    static void _dealloc_UserDataAccountProviderAddAccountOperation(py::wrapper::Windows::ApplicationModel::UserDataAccounts::Provider::UserDataAccountProviderAddAccountOperation* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* UserDataAccountProviderAddAccountOperation_ReportCompleted(py::wrapper::Windows::ApplicationModel::UserDataAccounts::Provider::UserDataAccountProviderAddAccountOperation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserDataAccounts.Provider.UserDataAccountProviderAddAccountOperation", L"ReportCompleted", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

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

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

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

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

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

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

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

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

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

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

    static PyMethodDef _methods_UserDataAccountProviderAddAccountOperation[] = {
        { "report_completed", reinterpret_cast<PyCFunction>(UserDataAccountProviderAddAccountOperation_ReportCompleted), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_UserDataAccountProviderAddAccountOperation, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_UserDataAccountProviderAddAccountOperation), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_UserDataAccountProviderAddAccountOperation[] = {
        { "content_kinds", reinterpret_cast<getter>(UserDataAccountProviderAddAccountOperation_get_ContentKinds), nullptr, nullptr, nullptr },
        { "partner_account_infos", reinterpret_cast<getter>(UserDataAccountProviderAddAccountOperation_get_PartnerAccountInfos), nullptr, nullptr, nullptr },
        { "kind", reinterpret_cast<getter>(UserDataAccountProviderAddAccountOperation_get_Kind), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_UserDataAccountProviderAddAccountOperation[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_UserDataAccountProviderAddAccountOperation) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_UserDataAccountProviderAddAccountOperation) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_UserDataAccountProviderAddAccountOperation) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_UserDataAccountProviderAddAccountOperation) },
        { },
    };

    static PyType_Spec type_spec_UserDataAccountProviderAddAccountOperation =
    {
        "_winsdk_Windows_ApplicationModel_UserDataAccounts_Provider.UserDataAccountProviderAddAccountOperation",
        sizeof(py::wrapper::Windows::ApplicationModel::UserDataAccounts::Provider::UserDataAccountProviderAddAccountOperation),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_UserDataAccountProviderAddAccountOperation
    };

    // ----- UserDataAccountProviderResolveErrorsOperation class --------------------
    static constexpr const char* const type_name_UserDataAccountProviderResolveErrorsOperation = "UserDataAccountProviderResolveErrorsOperation";

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

    static void _dealloc_UserDataAccountProviderResolveErrorsOperation(py::wrapper::Windows::ApplicationModel::UserDataAccounts::Provider::UserDataAccountProviderResolveErrorsOperation* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* UserDataAccountProviderResolveErrorsOperation_ReportCompleted(py::wrapper::Windows::ApplicationModel::UserDataAccounts::Provider::UserDataAccountProviderResolveErrorsOperation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserDataAccounts.Provider.UserDataAccountProviderResolveErrorsOperation", L"ReportCompleted", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

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

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

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

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

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

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

    static PyMethodDef _methods_UserDataAccountProviderResolveErrorsOperation[] = {
        { "report_completed", reinterpret_cast<PyCFunction>(UserDataAccountProviderResolveErrorsOperation_ReportCompleted), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_UserDataAccountProviderResolveErrorsOperation, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_UserDataAccountProviderResolveErrorsOperation), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_UserDataAccountProviderResolveErrorsOperation[] = {
        { "kind", reinterpret_cast<getter>(UserDataAccountProviderResolveErrorsOperation_get_Kind), nullptr, nullptr, nullptr },
        { "user_data_account_id", reinterpret_cast<getter>(UserDataAccountProviderResolveErrorsOperation_get_UserDataAccountId), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_UserDataAccountProviderResolveErrorsOperation[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_UserDataAccountProviderResolveErrorsOperation) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_UserDataAccountProviderResolveErrorsOperation) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_UserDataAccountProviderResolveErrorsOperation) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_UserDataAccountProviderResolveErrorsOperation) },
        { },
    };

    static PyType_Spec type_spec_UserDataAccountProviderResolveErrorsOperation =
    {
        "_winsdk_Windows_ApplicationModel_UserDataAccounts_Provider.UserDataAccountProviderResolveErrorsOperation",
        sizeof(py::wrapper::Windows::ApplicationModel::UserDataAccounts::Provider::UserDataAccountProviderResolveErrorsOperation),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_UserDataAccountProviderResolveErrorsOperation
    };

    // ----- UserDataAccountProviderSettingsOperation class --------------------
    static constexpr const char* const type_name_UserDataAccountProviderSettingsOperation = "UserDataAccountProviderSettingsOperation";

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

    static void _dealloc_UserDataAccountProviderSettingsOperation(py::wrapper::Windows::ApplicationModel::UserDataAccounts::Provider::UserDataAccountProviderSettingsOperation* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* UserDataAccountProviderSettingsOperation_ReportCompleted(py::wrapper::Windows::ApplicationModel::UserDataAccounts::Provider::UserDataAccountProviderSettingsOperation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.UserDataAccounts.Provider.UserDataAccountProviderSettingsOperation", L"ReportCompleted", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

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

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

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

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

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

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

    static PyMethodDef _methods_UserDataAccountProviderSettingsOperation[] = {
        { "report_completed", reinterpret_cast<PyCFunction>(UserDataAccountProviderSettingsOperation_ReportCompleted), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_UserDataAccountProviderSettingsOperation, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_UserDataAccountProviderSettingsOperation), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_UserDataAccountProviderSettingsOperation[] = {
        { "kind", reinterpret_cast<getter>(UserDataAccountProviderSettingsOperation_get_Kind), nullptr, nullptr, nullptr },
        { "user_data_account_id", reinterpret_cast<getter>(UserDataAccountProviderSettingsOperation_get_UserDataAccountId), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_UserDataAccountProviderSettingsOperation[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_UserDataAccountProviderSettingsOperation) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_UserDataAccountProviderSettingsOperation) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_UserDataAccountProviderSettingsOperation) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_UserDataAccountProviderSettingsOperation) },
        { },
    };

    static PyType_Spec type_spec_UserDataAccountProviderSettingsOperation =
    {
        "_winsdk_Windows_ApplicationModel_UserDataAccounts_Provider.UserDataAccountProviderSettingsOperation",
        sizeof(py::wrapper::Windows::ApplicationModel::UserDataAccounts::Provider::UserDataAccountProviderSettingsOperation),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_UserDataAccountProviderSettingsOperation
    };

    // ----- IUserDataAccountProviderOperation interface --------------------
    static constexpr const char* const type_name_IUserDataAccountProviderOperation = "IUserDataAccountProviderOperation";

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

    static void _dealloc_IUserDataAccountProviderOperation(py::wrapper::Windows::ApplicationModel::UserDataAccounts::Provider::IUserDataAccountProviderOperation* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

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

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

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

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

    static PyMethodDef _methods_IUserDataAccountProviderOperation[] = {
        { "_assign_array_", _assign_array_IUserDataAccountProviderOperation, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_IUserDataAccountProviderOperation), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_IUserDataAccountProviderOperation[] = {
        { "kind", reinterpret_cast<getter>(IUserDataAccountProviderOperation_get_Kind), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_IUserDataAccountProviderOperation[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_IUserDataAccountProviderOperation) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IUserDataAccountProviderOperation) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IUserDataAccountProviderOperation) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IUserDataAccountProviderOperation) },
        { },
    };

    static PyType_Spec type_spec_IUserDataAccountProviderOperation =
    {
        "_winsdk_Windows_ApplicationModel_UserDataAccounts_Provider.IUserDataAccountProviderOperation",
        sizeof(py::wrapper::Windows::ApplicationModel::UserDataAccounts::Provider::IUserDataAccountProviderOperation),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_IUserDataAccountProviderOperation
    };

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

    static PyMethodDef module_methods[] = {
        {"_register_UserDataAccountProviderOperationKind", register_UserDataAccountProviderOperationKind, METH_O, "registers type"},
        {"_register_UserDataAccountProviderPartnerAccountKind", register_UserDataAccountProviderPartnerAccountKind, METH_O, "registers type"},
        {}};


    static int module_traverse(PyObject* module, visitproc visit, void* arg) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));

        if (!state)
        {
            return 0;
        }

        Py_VISIT(state->type_UserDataAccountProviderOperationKind);
        Py_VISIT(state->type_UserDataAccountProviderPartnerAccountKind);
        Py_VISIT(state->type_UserDataAccountPartnerAccountInfo);
        Py_VISIT(state->type_UserDataAccountProviderAddAccountOperation);
        Py_VISIT(state->type_UserDataAccountProviderResolveErrorsOperation);
        Py_VISIT(state->type_UserDataAccountProviderSettingsOperation);
        Py_VISIT(state->type_IUserDataAccountProviderOperation);

        return 0;
    }

    static int module_clear(PyObject* module) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));

        if (!state)
        {
            return 0;
        }

        Py_CLEAR(state->type_UserDataAccountProviderOperationKind);
        Py_CLEAR(state->type_UserDataAccountProviderPartnerAccountKind);
        Py_CLEAR(state->type_UserDataAccountPartnerAccountInfo);
        Py_CLEAR(state->type_UserDataAccountProviderAddAccountOperation);
        Py_CLEAR(state->type_UserDataAccountProviderResolveErrorsOperation);
        Py_CLEAR(state->type_UserDataAccountProviderSettingsOperation);
        Py_CLEAR(state->type_IUserDataAccountProviderOperation);

        return 0;
    }


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

} // py::cpp::Windows::ApplicationModel::UserDataAccounts::Provider

PyMODINIT_FUNC PyInit__winsdk_Windows_ApplicationModel_UserDataAccounts_Provider(void) noexcept
{
    using namespace py::cpp::Windows::ApplicationModel::UserDataAccounts::Provider;

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

    if (!module)
    {
        return nullptr;
    }

    auto object_type = py::get_python_type<py::Object>();
    if (!object_type)
    {
        return nullptr;
    }

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

    if (!bases)
    {
        return nullptr;
    }

    py::pyobj_handle collections_abc_module{PyImport_ImportModule("collections.abc")};

    if (!collections_abc_module)
    {
        return nullptr;
    }

    py::pyobj_handle sequence_type{PyObject_GetAttrString(collections_abc_module.get(), "Sequence")};

    if (!sequence_type)
    {
        return nullptr;
    }

    py::pyobj_handle sequence_bases{PyTuple_Pack(2, object_type, sequence_type.get())};

    if (!sequence_bases)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_sequence_type{PyObject_GetAttrString(collections_abc_module.get(), "MutableSequence")};

    if (!mutable_sequence_type)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_sequence_bases{PyTuple_Pack(2, object_type, mutable_sequence_type.get())};

    if (!mutable_sequence_bases)
    {
        return nullptr;
    }

    py::pyobj_handle mapping_type{PyObject_GetAttrString(collections_abc_module.get(), "Mapping")};

    if (!mapping_type)
    {
        return nullptr;
    }

    py::pyobj_handle mapping_bases{PyTuple_Pack(2, object_type, mapping_type.get())};

    if (!mapping_bases)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_mapping_type{PyObject_GetAttrString(collections_abc_module.get(), "MutableMapping")};

    if (!mutable_mapping_type)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_mapping_bases{PyTuple_Pack(2, object_type, mutable_mapping_type.get())};

    if (!mutable_mapping_bases)
    {
        return nullptr;
    }

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

    state->type_UserDataAccountPartnerAccountInfo = py::register_python_type(module.get(), type_name_UserDataAccountPartnerAccountInfo, &type_spec_UserDataAccountPartnerAccountInfo, bases.get(), nullptr);
    if (!state->type_UserDataAccountPartnerAccountInfo)
    {
        return nullptr;
    }

    state->type_UserDataAccountProviderAddAccountOperation = py::register_python_type(module.get(), type_name_UserDataAccountProviderAddAccountOperation, &type_spec_UserDataAccountProviderAddAccountOperation, bases.get(), nullptr);
    if (!state->type_UserDataAccountProviderAddAccountOperation)
    {
        return nullptr;
    }

    state->type_UserDataAccountProviderResolveErrorsOperation = py::register_python_type(module.get(), type_name_UserDataAccountProviderResolveErrorsOperation, &type_spec_UserDataAccountProviderResolveErrorsOperation, bases.get(), nullptr);
    if (!state->type_UserDataAccountProviderResolveErrorsOperation)
    {
        return nullptr;
    }

    state->type_UserDataAccountProviderSettingsOperation = py::register_python_type(module.get(), type_name_UserDataAccountProviderSettingsOperation, &type_spec_UserDataAccountProviderSettingsOperation, bases.get(), nullptr);
    if (!state->type_UserDataAccountProviderSettingsOperation)
    {
        return nullptr;
    }

    state->type_IUserDataAccountProviderOperation = py::register_python_type(module.get(), type_name_IUserDataAccountProviderOperation, &type_spec_IUserDataAccountProviderOperation, bases.get(), nullptr);
    if (!state->type_IUserDataAccountProviderOperation)
    {
        return nullptr;
    }


    return module.detach();
}

PyObject* py::py_type<winrt::Windows::ApplicationModel::UserDataAccounts::Provider::UserDataAccountProviderOperationKind>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::UserDataAccounts::Provider;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_UserDataAccountProviderOperationKind;

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

    return python_type;
}

PyObject* py::py_type<winrt::Windows::ApplicationModel::UserDataAccounts::Provider::UserDataAccountProviderPartnerAccountKind>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::UserDataAccounts::Provider;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_UserDataAccountProviderPartnerAccountKind;

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

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::UserDataAccounts::Provider::UserDataAccountPartnerAccountInfo>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::UserDataAccounts::Provider;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_UserDataAccountPartnerAccountInfo;

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

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::UserDataAccounts::Provider::UserDataAccountProviderAddAccountOperation>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::UserDataAccounts::Provider;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_UserDataAccountProviderAddAccountOperation;

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

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::UserDataAccounts::Provider::UserDataAccountProviderResolveErrorsOperation>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::UserDataAccounts::Provider;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_UserDataAccountProviderResolveErrorsOperation;

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

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::UserDataAccounts::Provider::UserDataAccountProviderSettingsOperation>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::UserDataAccounts::Provider;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_UserDataAccountProviderSettingsOperation;

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

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::UserDataAccounts::Provider::IUserDataAccountProviderOperation>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::UserDataAccounts::Provider;

    PyObject* module = PyState_FindModule(&module_def);

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

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

    auto python_type = state->type_IUserDataAccountProviderOperation;

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

    return python_type;
}
