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

#include "py.Windows.Phone.Management.Deployment.h"


namespace py::cpp::Windows::Phone::Management::Deployment
{
    // ----- Enterprise class --------------------

    static PyObject* _new_Enterprise(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Phone::Management::Deployment::Enterprise>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Phone::Management::Deployment::Enterprise>::type_name);
        return nullptr;
    }

    static void _dealloc_Enterprise(py::wrapper::Windows::Phone::Management::Deployment::Enterprise* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* Enterprise_get_EnrollmentValidFrom(py::wrapper::Windows::Phone::Management::Deployment::Enterprise* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Phone.Management.Deployment.Enterprise", L"EnrollmentValidFrom"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* Enterprise_get_EnrollmentValidTo(py::wrapper::Windows::Phone::Management::Deployment::Enterprise* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Phone.Management.Deployment.Enterprise", L"EnrollmentValidTo"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* Enterprise_get_Id(py::wrapper::Windows::Phone::Management::Deployment::Enterprise* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Phone.Management.Deployment.Enterprise", L"Id"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

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

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

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

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

    static PyObject* Enterprise_get_WorkplaceId(py::wrapper::Windows::Phone::Management::Deployment::Enterprise* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Phone.Management.Deployment.Enterprise", L"WorkplaceId"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* _assign_array_Enterprise(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Phone::Management::Deployment::Enterprise>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_Enterprise(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::Phone::Management::Deployment::Enterprise>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_Enterprise[] = {
        { "_assign_array_", _assign_array_Enterprise, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_Enterprise), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_Enterprise[] = {
        { "enrollment_valid_from", reinterpret_cast<getter>(Enterprise_get_EnrollmentValidFrom), nullptr, nullptr, nullptr },
        { "enrollment_valid_to", reinterpret_cast<getter>(Enterprise_get_EnrollmentValidTo), nullptr, nullptr, nullptr },
        { "id", reinterpret_cast<getter>(Enterprise_get_Id), nullptr, nullptr, nullptr },
        { "name", reinterpret_cast<getter>(Enterprise_get_Name), nullptr, nullptr, nullptr },
        { "status", reinterpret_cast<getter>(Enterprise_get_Status), nullptr, nullptr, nullptr },
        { "workplace_id", reinterpret_cast<getter>(Enterprise_get_WorkplaceId), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_Enterprise[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_Enterprise) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_Enterprise) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_Enterprise) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_Enterprise) },
        { },
    };

    static PyType_Spec type_spec_Enterprise =
    {
        "winrt._winrt_windows_phone_management_deployment.Enterprise",
        sizeof(py::wrapper::Windows::Phone::Management::Deployment::Enterprise),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_Enterprise
    };

    // ----- EnterpriseEnrollmentManager class --------------------

    static PyObject* _new_EnterpriseEnrollmentManager(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Phone::Management::Deployment::EnterpriseEnrollmentManager>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Phone::Management::Deployment::EnterpriseEnrollmentManager>::type_name);
        return nullptr;
    }

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

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Phone.Management.Deployment.EnterpriseEnrollmentManager", L"RequestEnrollmentAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

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

                return py::convert(winrt::Windows::Phone::Management::Deployment::EnterpriseEnrollmentManager::RequestEnrollmentAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Phone.Management.Deployment.EnterpriseEnrollmentManager", L"RequestUnenrollmentAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Phone::Management::Deployment::Enterprise>(args, 0);

                return py::convert(winrt::Windows::Phone::Management::Deployment::EnterpriseEnrollmentManager::RequestUnenrollmentAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Phone.Management.Deployment.EnterpriseEnrollmentManager", L"ValidateEnterprisesAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Phone::Management::Deployment::EnterpriseEnrollmentManager::ValidateEnterprisesAsync());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* EnterpriseEnrollmentManager_get_CurrentEnterprise(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Phone.Management.Deployment.EnterpriseEnrollmentManager", L"CurrentEnterprise"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Phone::Management::Deployment::EnterpriseEnrollmentManager::CurrentEnterprise());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* EnterpriseEnrollmentManager_get_EnrolledEnterprises(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Phone.Management.Deployment.EnterpriseEnrollmentManager", L"EnrolledEnterprises"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            return py::convert(winrt::Windows::Phone::Management::Deployment::EnterpriseEnrollmentManager::EnrolledEnterprises());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_EnterpriseEnrollmentManager[] = {
        { }
    };

    static PyGetSetDef _getset_EnterpriseEnrollmentManager[] = {
        { }
    };

    static PyType_Slot _type_slots_EnterpriseEnrollmentManager[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_EnterpriseEnrollmentManager) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_EnterpriseEnrollmentManager) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_EnterpriseEnrollmentManager) },
        { },
    };

    static PyType_Spec type_spec_EnterpriseEnrollmentManager =
    {
        "winrt._winrt_windows_phone_management_deployment.EnterpriseEnrollmentManager",
        0,
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_EnterpriseEnrollmentManager
    };

    static PyGetSetDef getset_EnterpriseEnrollmentManager_Static[] = {
        { "current_enterprise", reinterpret_cast<getter>(EnterpriseEnrollmentManager_get_CurrentEnterprise), nullptr, nullptr, nullptr },
        { "enrolled_enterprises", reinterpret_cast<getter>(EnterpriseEnrollmentManager_get_EnrolledEnterprises), nullptr, nullptr, nullptr },
        { }
    };

    static PyMethodDef methods_EnterpriseEnrollmentManager_Static[] = {
        { "request_enrollment_async", reinterpret_cast<PyCFunction>(EnterpriseEnrollmentManager_RequestEnrollmentAsync), METH_VARARGS, nullptr },
        { "request_unenrollment_async", reinterpret_cast<PyCFunction>(EnterpriseEnrollmentManager_RequestUnenrollmentAsync), METH_VARARGS, nullptr },
        { "validate_enterprises_async", reinterpret_cast<PyCFunction>(EnterpriseEnrollmentManager_ValidateEnterprisesAsync), METH_VARARGS, nullptr },
        { }
    };

    static PyType_Slot type_slots_EnterpriseEnrollmentManager_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_EnterpriseEnrollmentManager_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_EnterpriseEnrollmentManager_Static) },
        { }
    };

    static PyType_Spec type_spec_EnterpriseEnrollmentManager_Static =
    {
        "winrt._winrt_windows_phone_management_deployment.EnterpriseEnrollmentManager_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_EnterpriseEnrollmentManager_Static
    };

    // ----- EnterpriseEnrollmentResult class --------------------

    static PyObject* _new_EnterpriseEnrollmentResult(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Phone::Management::Deployment::EnterpriseEnrollmentResult>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Phone::Management::Deployment::EnterpriseEnrollmentResult>::type_name);
        return nullptr;
    }

    static void _dealloc_EnterpriseEnrollmentResult(py::wrapper::Windows::Phone::Management::Deployment::EnterpriseEnrollmentResult* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* EnterpriseEnrollmentResult_get_EnrolledEnterprise(py::wrapper::Windows::Phone::Management::Deployment::EnterpriseEnrollmentResult* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Phone.Management.Deployment.EnterpriseEnrollmentResult", L"EnrolledEnterprise"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

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

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

    static PyObject* _assign_array_EnterpriseEnrollmentResult(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Phone::Management::Deployment::EnterpriseEnrollmentResult>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_EnterpriseEnrollmentResult(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::Phone::Management::Deployment::EnterpriseEnrollmentResult>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_EnterpriseEnrollmentResult[] = {
        { "_assign_array_", _assign_array_EnterpriseEnrollmentResult, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_EnterpriseEnrollmentResult), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_EnterpriseEnrollmentResult[] = {
        { "enrolled_enterprise", reinterpret_cast<getter>(EnterpriseEnrollmentResult_get_EnrolledEnterprise), nullptr, nullptr, nullptr },
        { "status", reinterpret_cast<getter>(EnterpriseEnrollmentResult_get_Status), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_EnterpriseEnrollmentResult[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_EnterpriseEnrollmentResult) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_EnterpriseEnrollmentResult) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_EnterpriseEnrollmentResult) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_EnterpriseEnrollmentResult) },
        { },
    };

    static PyType_Spec type_spec_EnterpriseEnrollmentResult =
    {
        "winrt._winrt_windows_phone_management_deployment.EnterpriseEnrollmentResult",
        sizeof(py::wrapper::Windows::Phone::Management::Deployment::EnterpriseEnrollmentResult),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_EnterpriseEnrollmentResult
    };

    // ----- InstallationManager class --------------------

    static PyObject* _new_InstallationManager(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Phone::Management::Deployment::InstallationManager>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Phone::Management::Deployment::InstallationManager>::type_name);
        return nullptr;
    }

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

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Phone.Management.Deployment.InstallationManager", L"AddPackageAsync", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::hstring>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::Uri>(args, 1);

                return py::convert(winrt::Windows::Phone::Management::Deployment::InstallationManager::AddPackageAsync(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 5)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Phone.Management.Deployment.InstallationManager", L"AddPackageAsync", 5))
            {
                py::set_arg_count_version_error(5);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::hstring>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::Uri>(args, 1);
                auto param2 = py::convert_to<winrt::hstring>(args, 2);
                auto param3 = py::convert_to<winrt::hstring>(args, 3);
                auto param4 = py::convert_to<winrt::Windows::Foundation::Uri>(args, 4);

                return py::convert(winrt::Windows::Phone::Management::Deployment::InstallationManager::AddPackageAsync(param0, param1, param2, param3, param4));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Phone.Management.Deployment.InstallationManager", L"FindPackages", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Phone::Management::Deployment::InstallationManager::FindPackages());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Phone.Management.Deployment.InstallationManager", L"FindPackages", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

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

                return py::convert(winrt::Windows::Phone::Management::Deployment::InstallationManager::FindPackages(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Phone.Management.Deployment.InstallationManager", L"FindPackagesForCurrentPublisher", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Phone::Management::Deployment::InstallationManager::FindPackagesForCurrentPublisher());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Phone.Management.Deployment.InstallationManager", L"GetPendingPackageInstalls", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Phone::Management::Deployment::InstallationManager::GetPendingPackageInstalls());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 3)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Phone.Management.Deployment.InstallationManager", L"RegisterPackageAsync", 3))
            {
                py::set_arg_count_version_error(3);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Foundation::Uri>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::Collections::IIterable<winrt::Windows::Foundation::Uri>>(args, 1);
                auto param2 = py::convert_to<winrt::Windows::Management::Deployment::DeploymentOptions>(args, 2);

                return py::convert(winrt::Windows::Phone::Management::Deployment::InstallationManager::RegisterPackageAsync(param0, param1, param2));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Phone.Management.Deployment.InstallationManager", L"RemovePackageAsync", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::hstring>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Management::Deployment::RemovalOptions>(args, 1);

                return py::convert(winrt::Windows::Phone::Management::Deployment::InstallationManager::RemovePackageAsync(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyMethodDef _methods_InstallationManager[] = {
        { }
    };

    static PyGetSetDef _getset_InstallationManager[] = {
        { }
    };

    static PyType_Slot _type_slots_InstallationManager[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_InstallationManager) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_InstallationManager) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_InstallationManager) },
        { },
    };

    static PyType_Spec type_spec_InstallationManager =
    {
        "winrt._winrt_windows_phone_management_deployment.InstallationManager",
        0,
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_InstallationManager
    };

    static PyGetSetDef getset_InstallationManager_Static[] = {
        { }
    };

    static PyMethodDef methods_InstallationManager_Static[] = {
        { "add_package_async", reinterpret_cast<PyCFunction>(InstallationManager_AddPackageAsync), METH_VARARGS, nullptr },
        { "find_packages", reinterpret_cast<PyCFunction>(InstallationManager_FindPackages), METH_VARARGS, nullptr },
        { "find_packages_for_current_publisher", reinterpret_cast<PyCFunction>(InstallationManager_FindPackagesForCurrentPublisher), METH_VARARGS, nullptr },
        { "get_pending_package_installs", reinterpret_cast<PyCFunction>(InstallationManager_GetPendingPackageInstalls), METH_VARARGS, nullptr },
        { "register_package_async", reinterpret_cast<PyCFunction>(InstallationManager_RegisterPackageAsync), METH_VARARGS, nullptr },
        { "remove_package_async", reinterpret_cast<PyCFunction>(InstallationManager_RemovePackageAsync), METH_VARARGS, nullptr },
        { }
    };

    static PyType_Slot type_slots_InstallationManager_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_InstallationManager_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_InstallationManager_Static) },
        { }
    };

    static PyType_Spec type_spec_InstallationManager_Static =
    {
        "winrt._winrt_windows_phone_management_deployment.InstallationManager_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_InstallationManager_Static
    };

    // ----- PackageInstallResult class --------------------

    static PyObject* _new_PackageInstallResult(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Phone::Management::Deployment::PackageInstallResult>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Phone::Management::Deployment::PackageInstallResult>::type_name);
        return nullptr;
    }

    static void _dealloc_PackageInstallResult(py::wrapper::Windows::Phone::Management::Deployment::PackageInstallResult* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PackageInstallResult_get_InstallState(py::wrapper::Windows::Phone::Management::Deployment::PackageInstallResult* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Phone.Management.Deployment.PackageInstallResult", L"InstallState"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* PackageInstallResult_get_ProductId(py::wrapper::Windows::Phone::Management::Deployment::PackageInstallResult* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Phone.Management.Deployment.PackageInstallResult", L"ProductId"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* PackageInstallResult_get_ErrorText(py::wrapper::Windows::Phone::Management::Deployment::PackageInstallResult* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Phone.Management.Deployment.PackageInstallResult", L"ErrorText"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* _assign_array_PackageInstallResult(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Phone::Management::Deployment::PackageInstallResult>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_PackageInstallResult(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::Phone::Management::Deployment::PackageInstallResult>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PackageInstallResult[] = {
        { "_assign_array_", _assign_array_PackageInstallResult, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PackageInstallResult), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_PackageInstallResult[] = {
        { "install_state", reinterpret_cast<getter>(PackageInstallResult_get_InstallState), nullptr, nullptr, nullptr },
        { "product_id", reinterpret_cast<getter>(PackageInstallResult_get_ProductId), nullptr, nullptr, nullptr },
        { "error_text", reinterpret_cast<getter>(PackageInstallResult_get_ErrorText), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_PackageInstallResult[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_PackageInstallResult) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PackageInstallResult) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PackageInstallResult) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PackageInstallResult) },
        { },
    };

    static PyType_Spec type_spec_PackageInstallResult =
    {
        "winrt._winrt_windows_phone_management_deployment.PackageInstallResult",
        sizeof(py::wrapper::Windows::Phone::Management::Deployment::PackageInstallResult),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PackageInstallResult
    };

    // ----- Windows.Phone.Management.Deployment Initialization --------------------
    PyDoc_STRVAR(module_doc, "Windows::Phone::Management::Deployment");


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

} // py::cpp::Windows::Phone::Management::Deployment

PyMODINIT_FUNC PyInit__winrt_windows_phone_management_deployment(void) noexcept
{
    using namespace py::cpp::Windows::Phone::Management::Deployment;

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

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

    if (!module)
    {
        return nullptr;
    }

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

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

    if (!object_bases)
    {
        return nullptr;
    }

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

    py::pyobj_handle type_EnterpriseEnrollmentManager_Static{PyType_FromSpec(&type_spec_EnterpriseEnrollmentManager_Static)};
    if (!type_EnterpriseEnrollmentManager_Static)
    {
        return nullptr;
    }

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

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

    py::pyobj_handle type_InstallationManager_Static{PyType_FromSpec(&type_spec_InstallationManager_Static)};
    if (!type_InstallationManager_Static)
    {
        return nullptr;
    }

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

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


    return module.detach();
}
