// ****************************************************** //
// Originally generated by scripts\controls.py, but now
// maintained manually.
// ****************************************************** //
#include "pch.h"
#include "_winui.h"

PYBIND11_EMBEDDED_MODULE(_winui_Windows_Foundation, m) {
    py::class_<IInspectable, ::pywinui::holder<IInspectable>>(m, "Windows.Foundation.IInspectable")
        .def("__repr__", [](const IInspectable& _self) { return default_repr(_self); } )
        .def("as_", [](const IInspectable& _self, const char *type) {
            std::string module_name{"_winui."};
            module_name += type;
            module_name.erase(module_name.find_last_of('.'));
            std::replace(std::begin(module_name), std::end(module_name), '.', '_');
            return py::module_::import(module_name.c_str()).attr(type)(_self);
        })
    ;

    py::class_<Deferral, ::pywinui::holder<Deferral>, IInspectable>(m, "Windows.Foundation.Deferral")
        .def(py::init([](const IInspectable &unk) { return ::pywinui::hold(unk.as<Deferral>()); }))
        .def("__repr__", [](const Deferral &_self) { return default_repr(_self); } )
        .def("Complete", [](Deferral &_self) { _self.Complete(); })
    ;

    py::class_<IAsyncOperation<winrt::hstring>, ::pywinui::holder<IAsyncOperation<winrt::hstring>>>(m, "Windows.Foundation.IAsyncOperation<winrt.hstring")
        .def("GetResults", [](const IAsyncOperation<winrt::hstring> &_self) { return ::pywinui::hold(_self.GetResults()); })
        .def("Completed", [](IAsyncOperation<winrt::hstring> &_self, py::object on_complete) {
            _self.Completed([on_complete](const IAsyncOperation<winrt::hstring> &op, AsyncStatus status) { default_on_complete(op, status, on_complete); });
        })
    ;

}
