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

#include "py.Windows.Gaming.Input.Preview.h"


namespace py::cpp::Windows::Gaming::Input::Preview
{
    // ----- GameControllerProviderInfo class --------------------

    static PyObject* _new_GameControllerProviderInfo(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Gaming::Input::Preview::GameControllerProviderInfo>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Gaming::Input::Preview::GameControllerProviderInfo>::type_name);
        return nullptr;
    }

    static PyObject* GameControllerProviderInfo_GetParentProviderId(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.Input.Preview.GameControllerProviderInfo", L"GetParentProviderId", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Gaming::Input::Custom::IGameControllerProvider>(args, 0);

                return py::convert(winrt::Windows::Gaming::Input::Preview::GameControllerProviderInfo::GetParentProviderId(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* GameControllerProviderInfo_GetProviderId(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.Input.Preview.GameControllerProviderInfo", L"GetProviderId", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::Gaming::Input::Custom::IGameControllerProvider>(args, 0);

                return py::convert(winrt::Windows::Gaming::Input::Preview::GameControllerProviderInfo::GetProviderId(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyMethodDef _methods_GameControllerProviderInfo[] = {
        { }
    };

    static PyGetSetDef _getset_GameControllerProviderInfo[] = {
        { }
    };

    static PyType_Slot _type_slots_GameControllerProviderInfo[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_GameControllerProviderInfo) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_GameControllerProviderInfo) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_GameControllerProviderInfo) },
        { },
    };

    static PyType_Spec type_spec_GameControllerProviderInfo =
    {
        "winrt._winrt_windows_gaming_input_preview.GameControllerProviderInfo",
        0,
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_GameControllerProviderInfo
    };

    static PyGetSetDef getset_GameControllerProviderInfo_Static[] = {
        { }
    };

    static PyMethodDef methods_GameControllerProviderInfo_Static[] = {
        { "get_parent_provider_id", reinterpret_cast<PyCFunction>(GameControllerProviderInfo_GetParentProviderId), METH_VARARGS, nullptr },
        { "get_provider_id", reinterpret_cast<PyCFunction>(GameControllerProviderInfo_GetProviderId), METH_VARARGS, nullptr },
        { }
    };

    static PyType_Slot type_slots_GameControllerProviderInfo_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_GameControllerProviderInfo_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_GameControllerProviderInfo_Static) },
        { }
    };

    static PyType_Spec type_spec_GameControllerProviderInfo_Static =
    {
        "winrt._winrt_windows_gaming_input_preview.GameControllerProviderInfo_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_GameControllerProviderInfo_Static
    };

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


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

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

PyMODINIT_FUNC PyInit__winrt_windows_gaming_input_preview(void) noexcept
{
    using namespace py::cpp::Windows::Gaming::Input::Preview;

    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;
    }

    py::pyobj_handle type_GameControllerProviderInfo_Static{PyType_FromSpec(&type_spec_GameControllerProviderInfo_Static)};
    if (!type_GameControllerProviderInfo_Static)
    {
        return nullptr;
    }

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


    return module.detach();
}
