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

#include "pybase.h"
#include "py.Windows.Gaming.Preview.GamesEnumeration.h"


namespace py::cpp::Windows::Gaming::Preview::GamesEnumeration
{
    struct module_state
    {
        PyObject* type_GameListCategory;
        PyObject* type_GameListEntryLaunchableState;
        PyTypeObject* type_GameList;
        PyTypeObject* type_GameListEntry;
        PyTypeObject* type_GameModeConfiguration;
        PyTypeObject* type_GameModeUserConfiguration;
        PyTypeObject* type_IGameListEntry;
    };

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

        if (state->type_GameListCategory)
        {
            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_GameListCategory = type;
        Py_INCREF(state->type_GameListCategory);


        Py_RETURN_NONE;
    }

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

        if (state->type_GameListEntryLaunchableState)
        {
            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_GameListEntryLaunchableState = type;
        Py_INCREF(state->type_GameListEntryLaunchableState);


        Py_RETURN_NONE;
    }

    // ----- GameList class --------------------
    static constexpr const char* const type_name_GameList = "GameList";

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

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

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameList", L"FindAllAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Gaming::Preview::GamesEnumeration::GameList::FindAllAsync());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameList", L"FindAllAsync", 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::Gaming::Preview::GamesEnumeration::GameList::FindAllAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameList", L"MergeEntriesAsync", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Gaming::Preview::GamesEnumeration::GameListEntry>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Gaming::Preview::GamesEnumeration::GameListEntry>(args, 1);

                return py::convert(winrt::Windows::Gaming::Preview::GamesEnumeration::GameList::MergeEntriesAsync(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameList", L"UnmergeEntryAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Gaming::Preview::GamesEnumeration::GameListEntry>(args, 0);

                return py::convert(winrt::Windows::Gaming::Preview::GamesEnumeration::GameList::UnmergeEntryAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* GameList_add_GameAdded(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameList", L"GameAdded"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Gaming::Preview::GamesEnumeration::GameListChangedEventHandler>(arg);

            return py::convert(winrt::Windows::Gaming::Preview::GamesEnumeration::GameList::GameAdded(param0));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GameList_remove_GameAdded(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameList", L"GameAdded"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            winrt::Windows::Gaming::Preview::GamesEnumeration::GameList::GameAdded(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GameList_add_GameRemoved(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameList", L"GameRemoved"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Gaming::Preview::GamesEnumeration::GameListRemovedEventHandler>(arg);

            return py::convert(winrt::Windows::Gaming::Preview::GamesEnumeration::GameList::GameRemoved(param0));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GameList_remove_GameRemoved(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameList", L"GameRemoved"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            winrt::Windows::Gaming::Preview::GamesEnumeration::GameList::GameRemoved(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GameList_add_GameUpdated(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameList", L"GameUpdated"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Gaming::Preview::GamesEnumeration::GameListChangedEventHandler>(arg);

            return py::convert(winrt::Windows::Gaming::Preview::GamesEnumeration::GameList::GameUpdated(param0));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* GameList_remove_GameUpdated(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameList", L"GameUpdated"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

            winrt::Windows::Gaming::Preview::GamesEnumeration::GameList::GameUpdated(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_GameList[] = {
        { "find_all_async", reinterpret_cast<PyCFunction>(GameList_FindAllAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "merge_entries_async", reinterpret_cast<PyCFunction>(GameList_MergeEntriesAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "unmerge_entry_async", reinterpret_cast<PyCFunction>(GameList_UnmergeEntryAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "add_game_added", reinterpret_cast<PyCFunction>(GameList_add_GameAdded), METH_O | METH_STATIC, nullptr },
        { "remove_game_added", reinterpret_cast<PyCFunction>(GameList_remove_GameAdded), METH_O | METH_STATIC, nullptr },
        { "add_game_removed", reinterpret_cast<PyCFunction>(GameList_add_GameRemoved), METH_O | METH_STATIC, nullptr },
        { "remove_game_removed", reinterpret_cast<PyCFunction>(GameList_remove_GameRemoved), METH_O | METH_STATIC, nullptr },
        { "add_game_updated", reinterpret_cast<PyCFunction>(GameList_add_GameUpdated), METH_O | METH_STATIC, nullptr },
        { "remove_game_updated", reinterpret_cast<PyCFunction>(GameList_remove_GameUpdated), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_GameList[] = {
        { }
    };

    static PyType_Slot _type_slots_GameList[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_GameList) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_GameList) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_GameList) },
        { },
    };

    static PyType_Spec type_spec_GameList =
    {
        "_winsdk_Windows_Gaming_Preview_GamesEnumeration.GameList",
        0,
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_GameList
    };

    // ----- GameListEntry class --------------------
    static constexpr const char* const type_name_GameListEntry = "GameListEntry";

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

    static void _dealloc_GameListEntry(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameListEntry* 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* GameListEntry_LaunchAsync(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameListEntry* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameListEntry", L"LaunchAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* GameListEntry_SetCategoryAsync(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameListEntry* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameListEntry", L"SetCategoryAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Gaming::Preview::GamesEnumeration::GameListCategory>(args, 0);

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

    static PyObject* GameListEntry_SetLauncherExecutableFileAsync(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameListEntry* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameListEntry", L"SetLauncherExecutableFileAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

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

                return py::convert(self->obj.SetLauncherExecutableFileAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 2)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameListEntry", L"SetLauncherExecutableFileAsync", 2))
            {
                py::set_arg_count_version_error(2);
                return nullptr;
            }

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

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

    static PyObject* GameListEntry_SetTitleIdAsync(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameListEntry* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameListEntry", L"SetTitleIdAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

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

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

    static PyObject* GameListEntry_get_Category(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameListEntry* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameListEntry", L"Category"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* GameListEntry_get_DisplayInfo(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameListEntry* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameListEntry", L"DisplayInfo"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* GameListEntry_get_Properties(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameListEntry* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameListEntry", L"Properties"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* GameListEntry_get_GameModeConfiguration(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameListEntry* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameListEntry", L"GameModeConfiguration"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* GameListEntry_get_LaunchParameters(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameListEntry* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameListEntry", L"LaunchParameters"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* GameListEntry_get_LaunchableState(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameListEntry* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameListEntry", L"LaunchableState"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* GameListEntry_get_LauncherExecutable(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameListEntry* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameListEntry", L"LauncherExecutable"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* GameListEntry_get_TitleId(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameListEntry* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameListEntry", L"TitleId"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* _assign_array_GameListEntry(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Gaming::Preview::GamesEnumeration::GameListEntry>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_GameListEntry(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::Gaming::Preview::GamesEnumeration::GameListEntry>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_GameListEntry[] = {
        { "launch_async", reinterpret_cast<PyCFunction>(GameListEntry_LaunchAsync), METH_VARARGS, nullptr },
        { "set_category_async", reinterpret_cast<PyCFunction>(GameListEntry_SetCategoryAsync), METH_VARARGS, nullptr },
        { "set_launcher_executable_file_async", reinterpret_cast<PyCFunction>(GameListEntry_SetLauncherExecutableFileAsync), METH_VARARGS, nullptr },
        { "set_title_id_async", reinterpret_cast<PyCFunction>(GameListEntry_SetTitleIdAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_GameListEntry, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_GameListEntry), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_GameListEntry[] = {
        { "category", reinterpret_cast<getter>(GameListEntry_get_Category), nullptr, nullptr, nullptr },
        { "display_info", reinterpret_cast<getter>(GameListEntry_get_DisplayInfo), nullptr, nullptr, nullptr },
        { "properties", reinterpret_cast<getter>(GameListEntry_get_Properties), nullptr, nullptr, nullptr },
        { "game_mode_configuration", reinterpret_cast<getter>(GameListEntry_get_GameModeConfiguration), nullptr, nullptr, nullptr },
        { "launch_parameters", reinterpret_cast<getter>(GameListEntry_get_LaunchParameters), nullptr, nullptr, nullptr },
        { "launchable_state", reinterpret_cast<getter>(GameListEntry_get_LaunchableState), nullptr, nullptr, nullptr },
        { "launcher_executable", reinterpret_cast<getter>(GameListEntry_get_LauncherExecutable), nullptr, nullptr, nullptr },
        { "title_id", reinterpret_cast<getter>(GameListEntry_get_TitleId), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_GameListEntry[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_GameListEntry) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_GameListEntry) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_GameListEntry) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_GameListEntry) },
        { },
    };

    static PyType_Spec type_spec_GameListEntry =
    {
        "_winsdk_Windows_Gaming_Preview_GamesEnumeration.GameListEntry",
        sizeof(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameListEntry),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_GameListEntry
    };

    // ----- GameModeConfiguration class --------------------
    static constexpr const char* const type_name_GameModeConfiguration = "GameModeConfiguration";

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

    static void _dealloc_GameModeConfiguration(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration* 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* GameModeConfiguration_SaveAsync(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeConfiguration", L"SaveAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* GameModeConfiguration_get_PercentGpuTimeAllocatedToGame(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeConfiguration", L"PercentGpuTimeAllocatedToGame"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static int GameModeConfiguration_put_PercentGpuTimeAllocatedToGame(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeConfiguration", L"PercentGpuTimeAllocatedToGame"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

            self->obj.PercentGpuTimeAllocatedToGame(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* GameModeConfiguration_get_PercentGpuMemoryAllocatedToSystemCompositor(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeConfiguration", L"PercentGpuMemoryAllocatedToSystemCompositor"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static int GameModeConfiguration_put_PercentGpuMemoryAllocatedToSystemCompositor(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeConfiguration", L"PercentGpuMemoryAllocatedToSystemCompositor"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

            self->obj.PercentGpuMemoryAllocatedToSystemCompositor(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* GameModeConfiguration_get_PercentGpuMemoryAllocatedToGame(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeConfiguration", L"PercentGpuMemoryAllocatedToGame"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static int GameModeConfiguration_put_PercentGpuMemoryAllocatedToGame(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeConfiguration", L"PercentGpuMemoryAllocatedToGame"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

            self->obj.PercentGpuMemoryAllocatedToGame(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* GameModeConfiguration_get_MaxCpuCount(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeConfiguration", L"MaxCpuCount"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static int GameModeConfiguration_put_MaxCpuCount(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeConfiguration", L"MaxCpuCount"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

            self->obj.MaxCpuCount(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* GameModeConfiguration_get_IsEnabled(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeConfiguration", L"IsEnabled"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static int GameModeConfiguration_put_IsEnabled(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeConfiguration", L"IsEnabled"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

            self->obj.IsEnabled(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* GameModeConfiguration_get_CpuExclusivityMaskLow(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeConfiguration", L"CpuExclusivityMaskLow"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static int GameModeConfiguration_put_CpuExclusivityMaskLow(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeConfiguration", L"CpuExclusivityMaskLow"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

            self->obj.CpuExclusivityMaskLow(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* GameModeConfiguration_get_CpuExclusivityMaskHigh(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeConfiguration", L"CpuExclusivityMaskHigh"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static int GameModeConfiguration_put_CpuExclusivityMaskHigh(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeConfiguration", L"CpuExclusivityMaskHigh"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

            self->obj.CpuExclusivityMaskHigh(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* GameModeConfiguration_get_AffinitizeToExclusiveCpus(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeConfiguration", L"AffinitizeToExclusiveCpus"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static int GameModeConfiguration_put_AffinitizeToExclusiveCpus(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeConfiguration", L"AffinitizeToExclusiveCpus"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

            self->obj.AffinitizeToExclusiveCpus(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* GameModeConfiguration_get_RelatedProcessNames(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeConfiguration", L"RelatedProcessNames"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* _assign_array_GameModeConfiguration(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_GameModeConfiguration(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::Gaming::Preview::GamesEnumeration::GameModeConfiguration>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_GameModeConfiguration[] = {
        { "save_async", reinterpret_cast<PyCFunction>(GameModeConfiguration_SaveAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_GameModeConfiguration, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_GameModeConfiguration), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_GameModeConfiguration[] = {
        { "percent_gpu_time_allocated_to_game", reinterpret_cast<getter>(GameModeConfiguration_get_PercentGpuTimeAllocatedToGame), reinterpret_cast<setter>(GameModeConfiguration_put_PercentGpuTimeAllocatedToGame), nullptr, nullptr },
        { "percent_gpu_memory_allocated_to_system_compositor", reinterpret_cast<getter>(GameModeConfiguration_get_PercentGpuMemoryAllocatedToSystemCompositor), reinterpret_cast<setter>(GameModeConfiguration_put_PercentGpuMemoryAllocatedToSystemCompositor), nullptr, nullptr },
        { "percent_gpu_memory_allocated_to_game", reinterpret_cast<getter>(GameModeConfiguration_get_PercentGpuMemoryAllocatedToGame), reinterpret_cast<setter>(GameModeConfiguration_put_PercentGpuMemoryAllocatedToGame), nullptr, nullptr },
        { "max_cpu_count", reinterpret_cast<getter>(GameModeConfiguration_get_MaxCpuCount), reinterpret_cast<setter>(GameModeConfiguration_put_MaxCpuCount), nullptr, nullptr },
        { "is_enabled", reinterpret_cast<getter>(GameModeConfiguration_get_IsEnabled), reinterpret_cast<setter>(GameModeConfiguration_put_IsEnabled), nullptr, nullptr },
        { "cpu_exclusivity_mask_low", reinterpret_cast<getter>(GameModeConfiguration_get_CpuExclusivityMaskLow), reinterpret_cast<setter>(GameModeConfiguration_put_CpuExclusivityMaskLow), nullptr, nullptr },
        { "cpu_exclusivity_mask_high", reinterpret_cast<getter>(GameModeConfiguration_get_CpuExclusivityMaskHigh), reinterpret_cast<setter>(GameModeConfiguration_put_CpuExclusivityMaskHigh), nullptr, nullptr },
        { "affinitize_to_exclusive_cpus", reinterpret_cast<getter>(GameModeConfiguration_get_AffinitizeToExclusiveCpus), reinterpret_cast<setter>(GameModeConfiguration_put_AffinitizeToExclusiveCpus), nullptr, nullptr },
        { "related_process_names", reinterpret_cast<getter>(GameModeConfiguration_get_RelatedProcessNames), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_GameModeConfiguration[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_GameModeConfiguration) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_GameModeConfiguration) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_GameModeConfiguration) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_GameModeConfiguration) },
        { },
    };

    static PyType_Spec type_spec_GameModeConfiguration =
    {
        "_winsdk_Windows_Gaming_Preview_GamesEnumeration.GameModeConfiguration",
        sizeof(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_GameModeConfiguration
    };

    // ----- GameModeUserConfiguration class --------------------
    static constexpr const char* const type_name_GameModeUserConfiguration = "GameModeUserConfiguration";

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

    static void _dealloc_GameModeUserConfiguration(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeUserConfiguration* 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* GameModeUserConfiguration_GetDefault(PyObject* /*unused*/, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeUserConfiguration", L"GetDefault", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                return py::convert(winrt::Windows::Gaming::Preview::GamesEnumeration::GameModeUserConfiguration::GetDefault());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* GameModeUserConfiguration_SaveAsync(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeUserConfiguration* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeUserConfiguration", L"SaveAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* GameModeUserConfiguration_get_GamingRelatedProcessNames(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeUserConfiguration* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.GameModeUserConfiguration", L"GamingRelatedProcessNames"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* _assign_array_GameModeUserConfiguration(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Gaming::Preview::GamesEnumeration::GameModeUserConfiguration>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_GameModeUserConfiguration(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::Gaming::Preview::GamesEnumeration::GameModeUserConfiguration>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_GameModeUserConfiguration[] = {
        { "get_default", reinterpret_cast<PyCFunction>(GameModeUserConfiguration_GetDefault), METH_VARARGS | METH_STATIC, nullptr },
        { "save_async", reinterpret_cast<PyCFunction>(GameModeUserConfiguration_SaveAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_GameModeUserConfiguration, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_GameModeUserConfiguration), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_GameModeUserConfiguration[] = {
        { "gaming_related_process_names", reinterpret_cast<getter>(GameModeUserConfiguration_get_GamingRelatedProcessNames), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_GameModeUserConfiguration[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_GameModeUserConfiguration) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_GameModeUserConfiguration) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_GameModeUserConfiguration) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_GameModeUserConfiguration) },
        { },
    };

    static PyType_Spec type_spec_GameModeUserConfiguration =
    {
        "_winsdk_Windows_Gaming_Preview_GamesEnumeration.GameModeUserConfiguration",
        sizeof(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::GameModeUserConfiguration),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_GameModeUserConfiguration
    };

    // ----- IGameListEntry interface --------------------
    static constexpr const char* const type_name_IGameListEntry = "IGameListEntry";

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

    static void _dealloc_IGameListEntry(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::IGameListEntry* 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* IGameListEntry_LaunchAsync(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::IGameListEntry* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Preview.GamesEnumeration.IGameListEntry", L"LaunchAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* IGameListEntry_SetCategoryAsync(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::IGameListEntry* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Gaming.Preview.GamesEnumeration.IGameListEntry", L"SetCategoryAsync", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Gaming::Preview::GamesEnumeration::GameListCategory>(args, 0);

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

    static PyObject* IGameListEntry_get_Category(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::IGameListEntry* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.IGameListEntry", L"Category"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* IGameListEntry_get_DisplayInfo(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::IGameListEntry* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.IGameListEntry", L"DisplayInfo"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* IGameListEntry_get_Properties(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::IGameListEntry* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Gaming.Preview.GamesEnumeration.IGameListEntry", L"Properties"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* _assign_array_IGameListEntry(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Gaming::Preview::GamesEnumeration::IGameListEntry>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_IGameListEntry(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::Gaming::Preview::GamesEnumeration::IGameListEntry>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_IGameListEntry[] = {
        { "launch_async", reinterpret_cast<PyCFunction>(IGameListEntry_LaunchAsync), METH_VARARGS, nullptr },
        { "set_category_async", reinterpret_cast<PyCFunction>(IGameListEntry_SetCategoryAsync), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_IGameListEntry, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_IGameListEntry), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_IGameListEntry[] = {
        { "category", reinterpret_cast<getter>(IGameListEntry_get_Category), nullptr, nullptr, nullptr },
        { "display_info", reinterpret_cast<getter>(IGameListEntry_get_DisplayInfo), nullptr, nullptr, nullptr },
        { "properties", reinterpret_cast<getter>(IGameListEntry_get_Properties), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_IGameListEntry[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_IGameListEntry) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_IGameListEntry) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_IGameListEntry) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_IGameListEntry) },
        { },
    };

    static PyType_Spec type_spec_IGameListEntry =
    {
        "_winsdk_Windows_Gaming_Preview_GamesEnumeration.IGameListEntry",
        sizeof(py::wrapper::Windows::Gaming::Preview::GamesEnumeration::IGameListEntry),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_IGameListEntry
    };

    // ----- Windows.Gaming.Preview.GamesEnumeration Initialization --------------------
    PyDoc_STRVAR(module_doc, "Windows::Gaming::Preview::GamesEnumeration");

    static PyMethodDef module_methods[] = {
        {"_register_GameListCategory", register_GameListCategory, METH_O, "registers type"},
        {"_register_GameListEntryLaunchableState", register_GameListEntryLaunchableState, 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_GameListCategory);
        Py_VISIT(state->type_GameListEntryLaunchableState);
        Py_VISIT(state->type_GameList);
        Py_VISIT(state->type_GameListEntry);
        Py_VISIT(state->type_GameModeConfiguration);
        Py_VISIT(state->type_GameModeUserConfiguration);
        Py_VISIT(state->type_IGameListEntry);

        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_GameListCategory);
        Py_CLEAR(state->type_GameListEntryLaunchableState);
        Py_CLEAR(state->type_GameList);
        Py_CLEAR(state->type_GameListEntry);
        Py_CLEAR(state->type_GameModeConfiguration);
        Py_CLEAR(state->type_GameModeUserConfiguration);
        Py_CLEAR(state->type_IGameListEntry);

        return 0;
    }


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

} // py::cpp::Windows::Gaming::Preview::GamesEnumeration

PyMODINIT_FUNC PyInit__winsdk_Windows_Gaming_Preview_GamesEnumeration(void) noexcept
{
    using namespace py::cpp::Windows::Gaming::Preview::GamesEnumeration;

    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_GameList = py::register_python_type(module.get(), type_name_GameList, &type_spec_GameList, nullptr, nullptr);
    if (!state->type_GameList)
    {
        return nullptr;
    }

    state->type_GameListEntry = py::register_python_type(module.get(), type_name_GameListEntry, &type_spec_GameListEntry, bases.get(), nullptr);
    if (!state->type_GameListEntry)
    {
        return nullptr;
    }

    state->type_GameModeConfiguration = py::register_python_type(module.get(), type_name_GameModeConfiguration, &type_spec_GameModeConfiguration, bases.get(), nullptr);
    if (!state->type_GameModeConfiguration)
    {
        return nullptr;
    }

    state->type_GameModeUserConfiguration = py::register_python_type(module.get(), type_name_GameModeUserConfiguration, &type_spec_GameModeUserConfiguration, bases.get(), nullptr);
    if (!state->type_GameModeUserConfiguration)
    {
        return nullptr;
    }

    state->type_IGameListEntry = py::register_python_type(module.get(), type_name_IGameListEntry, &type_spec_IGameListEntry, bases.get(), nullptr);
    if (!state->type_IGameListEntry)
    {
        return nullptr;
    }


    return module.detach();
}

PyObject* py::py_type<winrt::Windows::Gaming::Preview::GamesEnumeration::GameListCategory>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Gaming::Preview::GamesEnumeration;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Gaming::Preview::GamesEnumeration");
        return nullptr;
    }

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

    auto python_type = state->type_GameListCategory;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Gaming::Preview::GamesEnumeration::GameListCategory is not registered");
        return nullptr;
    }

    return python_type;
}

PyObject* py::py_type<winrt::Windows::Gaming::Preview::GamesEnumeration::GameListEntryLaunchableState>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Gaming::Preview::GamesEnumeration;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Gaming::Preview::GamesEnumeration");
        return nullptr;
    }

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

    auto python_type = state->type_GameListEntryLaunchableState;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Gaming::Preview::GamesEnumeration::GameListEntryLaunchableState is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Gaming::Preview::GamesEnumeration::GameList>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Gaming::Preview::GamesEnumeration;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Gaming::Preview::GamesEnumeration");
        return nullptr;
    }

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

    auto python_type = state->type_GameList;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Gaming::Preview::GamesEnumeration::GameList is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Gaming::Preview::GamesEnumeration::GameListEntry>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Gaming::Preview::GamesEnumeration;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Gaming::Preview::GamesEnumeration");
        return nullptr;
    }

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

    auto python_type = state->type_GameListEntry;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Gaming::Preview::GamesEnumeration::GameListEntry is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Gaming::Preview::GamesEnumeration;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Gaming::Preview::GamesEnumeration");
        return nullptr;
    }

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

    auto python_type = state->type_GameModeConfiguration;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Gaming::Preview::GamesEnumeration::GameModeConfiguration is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Gaming::Preview::GamesEnumeration::GameModeUserConfiguration>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Gaming::Preview::GamesEnumeration;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Gaming::Preview::GamesEnumeration");
        return nullptr;
    }

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

    auto python_type = state->type_GameModeUserConfiguration;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Gaming::Preview::GamesEnumeration::GameModeUserConfiguration is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::Gaming::Preview::GamesEnumeration::IGameListEntry>::get_python_type() noexcept {
    using namespace py::cpp::Windows::Gaming::Preview::GamesEnumeration;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::Gaming::Preview::GamesEnumeration");
        return nullptr;
    }

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

    auto python_type = state->type_IGameListEntry;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::Gaming::Preview::GamesEnumeration::IGameListEntry is not registered");
        return nullptr;
    }

    return python_type;
}
