// WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0

#include "py.Windows.UI.Notifications.Preview.h"

namespace py::cpp::Windows::UI::Notifications::Preview
{
    // ----- ToastOcclusionManagerPreview class --------------------

    static PyObject* _new_ToastOcclusionManagerPreview(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::UI::Notifications::Preview::ToastOcclusionManagerPreview>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::UI::Notifications::Preview::ToastOcclusionManagerPreview>::type_name);
        return nullptr;
    }

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

        if (arg_count == 2)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.UI.Notifications.Preview.ToastOcclusionManagerPreview", L"SetToastWindowMargin", 2);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(2);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Windows::UI::WindowId>(args, 0);
                auto param1 = py::convert_to<double>(args, 1);

                winrt::Windows::UI::Notifications::Preview::ToastOcclusionManagerPreview::SetToastWindowMargin(param0, param1);
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyMethodDef _methods_ToastOcclusionManagerPreview[] = {
        { }
    };

    static PyGetSetDef _getset_ToastOcclusionManagerPreview[] = {
        { }
    };

    static PyType_Slot _type_slots_ToastOcclusionManagerPreview[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_ToastOcclusionManagerPreview) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_ToastOcclusionManagerPreview) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_ToastOcclusionManagerPreview) },
        { }
    };

    static PyType_Spec type_spec_ToastOcclusionManagerPreview = {
        "winrt._winrt_windows_ui_notifications_preview.ToastOcclusionManagerPreview",
        0,
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_ToastOcclusionManagerPreview};

    static PyGetSetDef getset_ToastOcclusionManagerPreview_Static[] = {
        { }
    };

    static PyMethodDef methods_ToastOcclusionManagerPreview_Static[] = {
        { "set_toast_window_margin", reinterpret_cast<PyCFunction>(ToastOcclusionManagerPreview_SetToastWindowMargin), METH_VARARGS, nullptr },
        { }
    };

    static PyType_Slot type_slots_ToastOcclusionManagerPreview_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_ToastOcclusionManagerPreview_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_ToastOcclusionManagerPreview_Static) },
        { }
    };

    static PyType_Spec type_spec_ToastOcclusionManagerPreview_Static =
    {
        "winrt._winrt_windows_ui_notifications_preview.ToastOcclusionManagerPreview_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_ToastOcclusionManagerPreview_Static
    };

    // ----- Windows.UI.Notifications.Preview Initialization --------------------

    PyDoc_STRVAR(module_doc, "Windows.UI.Notifications.Preview");

    static PyModuleDef module_def = {
        PyModuleDef_HEAD_INIT,
        "_winrt_windows_ui_notifications_preview",
        module_doc,
        0,
        nullptr,
        nullptr,
        nullptr,
        nullptr,
        nullptr};
} // py::cpp::Windows::UI::Notifications::Preview

PyMODINIT_FUNC PyInit__winrt_windows_ui_notifications_preview(void) noexcept
{
    using namespace py::cpp::Windows::UI::Notifications::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_ToastOcclusionManagerPreview_Static{PyType_FromSpec(&type_spec_ToastOcclusionManagerPreview_Static)};
    if (!type_ToastOcclusionManagerPreview_Static)
    {
        return nullptr;
    }

    py::pytype_handle ToastOcclusionManagerPreview_type{py::register_python_type(module.get(), &type_spec_ToastOcclusionManagerPreview, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_ToastOcclusionManagerPreview_Static.get()))};
    if (!ToastOcclusionManagerPreview_type)
    {
        return nullptr;
    }


    return module.detach();
}
