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

#include "pybase.h"
#include "py.Windows.ApplicationModel.Store.LicenseManagement.h"

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::Store::LicenseManagement::LicenseManager>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::Store::LicenseManagement::LicenseSatisfactionInfo>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::Store::LicenseManagement::LicenseSatisfactionResult>::python_type;

namespace py::cpp::Windows::ApplicationModel::Store::LicenseManagement
{
    // ----- LicenseManager class --------------------
    constexpr const char* const _type_name_LicenseManager = "LicenseManager";

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

    static PyObject* LicenseManager_AddLicenseAsync(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::Storage::Streams::IBuffer>(args, 0);

                return py::convert(winrt::Windows::ApplicationModel::Store::LicenseManagement::LicenseManager::AddLicenseAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

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

                return py::convert(winrt::Windows::ApplicationModel::Store::LicenseManagement::LicenseManager::GetSatisfactionInfosAsync(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* LicenseManager_RefreshLicensesAsync(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::ApplicationModel::Store::LicenseManagement::LicenseRefreshOption>(args, 0);

                return py::convert(winrt::Windows::ApplicationModel::Store::LicenseManagement::LicenseManager::RefreshLicensesAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyMethodDef _methods_LicenseManager[] = {
        { "add_license_async", reinterpret_cast<PyCFunction>(LicenseManager_AddLicenseAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "get_satisfaction_infos_async", reinterpret_cast<PyCFunction>(LicenseManager_GetSatisfactionInfosAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "refresh_licenses_async", reinterpret_cast<PyCFunction>(LicenseManager_RefreshLicensesAsync), METH_VARARGS | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_LicenseManager[] = {
        { }
    };

    static PyType_Slot _type_slots_LicenseManager[] = 
    {
        { Py_tp_new, _new_LicenseManager },
        { Py_tp_methods, _methods_LicenseManager },
        { Py_tp_getset, _getset_LicenseManager },
        { },
    };

    static PyType_Spec _type_spec_LicenseManager =
    {
        "_winsdk_Windows_ApplicationModel_Store_LicenseManagement.LicenseManager",
        0,
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_LicenseManager
    };

    // ----- LicenseSatisfactionInfo class --------------------
    constexpr const char* const _type_name_LicenseSatisfactionInfo = "LicenseSatisfactionInfo";

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

    static void _dealloc_LicenseSatisfactionInfo(py::wrapper::Windows::ApplicationModel::Store::LicenseManagement::LicenseSatisfactionInfo* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* LicenseSatisfactionInfo_get_IsSatisfied(py::wrapper::Windows::ApplicationModel::Store::LicenseManagement::LicenseSatisfactionInfo* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.IsSatisfied());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* LicenseSatisfactionInfo_get_SatisfiedByDevice(py::wrapper::Windows::ApplicationModel::Store::LicenseManagement::LicenseSatisfactionInfo* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.SatisfiedByDevice());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* LicenseSatisfactionInfo_get_SatisfiedByInstallMedia(py::wrapper::Windows::ApplicationModel::Store::LicenseManagement::LicenseSatisfactionInfo* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.SatisfiedByInstallMedia());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* LicenseSatisfactionInfo_get_SatisfiedByOpenLicense(py::wrapper::Windows::ApplicationModel::Store::LicenseManagement::LicenseSatisfactionInfo* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.SatisfiedByOpenLicense());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* LicenseSatisfactionInfo_get_SatisfiedByPass(py::wrapper::Windows::ApplicationModel::Store::LicenseManagement::LicenseSatisfactionInfo* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.SatisfiedByPass());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* LicenseSatisfactionInfo_get_SatisfiedBySignedInUser(py::wrapper::Windows::ApplicationModel::Store::LicenseManagement::LicenseSatisfactionInfo* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.SatisfiedBySignedInUser());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* LicenseSatisfactionInfo_get_SatisfiedByTrial(py::wrapper::Windows::ApplicationModel::Store::LicenseManagement::LicenseSatisfactionInfo* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.SatisfiedByTrial());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_LicenseSatisfactionInfo(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::Store::LicenseManagement::LicenseSatisfactionInfo>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyGetSetDef _getset_LicenseSatisfactionInfo[] = {
        { "is_satisfied", reinterpret_cast<getter>(LicenseSatisfactionInfo_get_IsSatisfied), nullptr, nullptr, nullptr },
        { "satisfied_by_device", reinterpret_cast<getter>(LicenseSatisfactionInfo_get_SatisfiedByDevice), nullptr, nullptr, nullptr },
        { "satisfied_by_install_media", reinterpret_cast<getter>(LicenseSatisfactionInfo_get_SatisfiedByInstallMedia), nullptr, nullptr, nullptr },
        { "satisfied_by_open_license", reinterpret_cast<getter>(LicenseSatisfactionInfo_get_SatisfiedByOpenLicense), nullptr, nullptr, nullptr },
        { "satisfied_by_pass", reinterpret_cast<getter>(LicenseSatisfactionInfo_get_SatisfiedByPass), nullptr, nullptr, nullptr },
        { "satisfied_by_signed_in_user", reinterpret_cast<getter>(LicenseSatisfactionInfo_get_SatisfiedBySignedInUser), nullptr, nullptr, nullptr },
        { "satisfied_by_trial", reinterpret_cast<getter>(LicenseSatisfactionInfo_get_SatisfiedByTrial), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_LicenseSatisfactionInfo[] = 
    {
        { Py_tp_new, _new_LicenseSatisfactionInfo },
        { Py_tp_dealloc, _dealloc_LicenseSatisfactionInfo },
        { Py_tp_methods, _methods_LicenseSatisfactionInfo },
        { Py_tp_getset, _getset_LicenseSatisfactionInfo },
        { },
    };

    static PyType_Spec _type_spec_LicenseSatisfactionInfo =
    {
        "_winsdk_Windows_ApplicationModel_Store_LicenseManagement.LicenseSatisfactionInfo",
        sizeof(py::wrapper::Windows::ApplicationModel::Store::LicenseManagement::LicenseSatisfactionInfo),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_LicenseSatisfactionInfo
    };

    // ----- LicenseSatisfactionResult class --------------------
    constexpr const char* const _type_name_LicenseSatisfactionResult = "LicenseSatisfactionResult";

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

    static void _dealloc_LicenseSatisfactionResult(py::wrapper::Windows::ApplicationModel::Store::LicenseManagement::LicenseSatisfactionResult* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* LicenseSatisfactionResult_get_ExtendedError(py::wrapper::Windows::ApplicationModel::Store::LicenseManagement::LicenseSatisfactionResult* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.ExtendedError());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* LicenseSatisfactionResult_get_LicenseSatisfactionInfos(py::wrapper::Windows::ApplicationModel::Store::LicenseManagement::LicenseSatisfactionResult* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.LicenseSatisfactionInfos());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_LicenseSatisfactionResult(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::Store::LicenseManagement::LicenseSatisfactionResult>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyGetSetDef _getset_LicenseSatisfactionResult[] = {
        { "extended_error", reinterpret_cast<getter>(LicenseSatisfactionResult_get_ExtendedError), nullptr, nullptr, nullptr },
        { "license_satisfaction_infos", reinterpret_cast<getter>(LicenseSatisfactionResult_get_LicenseSatisfactionInfos), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_LicenseSatisfactionResult[] = 
    {
        { Py_tp_new, _new_LicenseSatisfactionResult },
        { Py_tp_dealloc, _dealloc_LicenseSatisfactionResult },
        { Py_tp_methods, _methods_LicenseSatisfactionResult },
        { Py_tp_getset, _getset_LicenseSatisfactionResult },
        { },
    };

    static PyType_Spec _type_spec_LicenseSatisfactionResult =
    {
        "_winsdk_Windows_ApplicationModel_Store_LicenseManagement.LicenseSatisfactionResult",
        sizeof(py::wrapper::Windows::ApplicationModel::Store::LicenseManagement::LicenseSatisfactionResult),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_LicenseSatisfactionResult
    };

    // ----- Windows.ApplicationModel.Store.LicenseManagement 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::ApplicationModel::Store::LicenseManagement::LicenseManager>::python_type = py::register_python_type(module, _type_name_LicenseManager, &_type_spec_LicenseManager, nullptr);
            py::winrt_type<winrt::Windows::ApplicationModel::Store::LicenseManagement::LicenseSatisfactionInfo>::python_type = py::register_python_type(module, _type_name_LicenseSatisfactionInfo, &_type_spec_LicenseSatisfactionInfo, bases.get());
            py::winrt_type<winrt::Windows::ApplicationModel::Store::LicenseManagement::LicenseSatisfactionResult>::python_type = py::register_python_type(module, _type_name_LicenseSatisfactionResult, &_type_spec_LicenseSatisfactionResult, 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.ApplicationModel.Store.LicenseManagement");

    static PyModuleDef module_def
        = {PyModuleDef_HEAD_INIT,
           "_winsdk_Windows_ApplicationModel_Store_LicenseManagement",
           module_doc,
           0,
           nullptr,
           module_slots,
           nullptr,
           nullptr,
           nullptr};
} // py::cpp::Windows::ApplicationModel::Store::LicenseManagement

PyMODINIT_FUNC
PyInit__winsdk_Windows_ApplicationModel_Store_LicenseManagement (void) noexcept
{
    return PyModuleDef_Init(&py::cpp::Windows::ApplicationModel::Store::LicenseManagement::module_def);
}
